<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Untitled Document

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents TextBox6 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents TextBox7 As System.Windows.Forms.TextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents TextBox8 As System.Windows.Forms.TextBox
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents TextBox9 As System.Windows.Forms.TextBox
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents Label7 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.Label1 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.Label5 = New System.Windows.Forms.Label
Me.TextBox5 = New System.Windows.Forms.TextBox
Me.Label6 = New System.Windows.Forms.Label
Me.TextBox6 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.TextBox7 = New System.Windows.Forms.TextBox
Me.Button2 = New System.Windows.Forms.Button
Me.TextBox8 = New System.Windows.Forms.TextBox
Me.Button3 = New System.Windows.Forms.Button
Me.TextBox9 = New System.Windows.Forms.TextBox
Me.Button4 = New System.Windows.Forms.Button
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Label7 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(32, 56)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(112, 23)
Me.Label1.TabIndex = 0
Me.Label1.Text = "apperture size M.M."
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(152, 56)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(40, 20)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = ""
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(232, 56)
Me.Label2.Name = "Label2"
Me.Label2.TabIndex = 2
Me.Label2.Text = "sphere power"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(344, 56)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(48, 20)
Me.TextBox2.TabIndex = 3
Me.TextBox2.Text = ""
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(424, 56)
Me.Label3.Name = "Label3"
Me.Label3.TabIndex = 4
Me.Label3.Text = "front + curve"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(544, 56)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(48, 20)
Me.TextBox3.TabIndex = 5
Me.TextBox3.Text = ""
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(32, 144)
Me.Label4.Name = "Label4"
Me.Label4.TabIndex = 6
Me.Label4.Text = "lens dia.M.M."
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(152, 144)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(40, 20)
Me.TextBox4.TabIndex = 7
Me.TextBox4.Text = ""
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(232, 144)
Me.Label5.Name = "Label5"
Me.Label5.TabIndex = 8
Me.Label5.Text = "edge thickness"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'TextBox5
'
Me.TextBox5.Location = New System.Drawing.Point(344, 144)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.Size = New System.Drawing.Size(32, 20)
Me.TextBox5.TabIndex = 9
Me.TextBox5.Text = "1.0"
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(432, 144)
Me.Label6.Name = "Label6"
Me.Label6.TabIndex = 10
Me.Label6.Text = "centre thickness"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'TextBox6
'
Me.TextBox6.Location = New System.Drawing.Point(544, 144)
Me.TextBox6.Name = "TextBox6"
Me.TextBox6.Size = New System.Drawing.Size(32, 20)
Me.TextBox6.TabIndex = 11
Me.TextBox6.Text = "2.6"
'
'Button1
'
Me.Button1.BackColor = System.Drawing.Color.LightSkyBlue
Me.Button1.Location = New System.Drawing.Point(64, 232)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 12
Me.Button1.Text = "front sag"
Me.Button1.Visible = CType(configurationAppSettings.GetValue("Button1.Visible", GetType(System.Boolean)), Boolean)
'
'TextBox7
'
Me.TextBox7.Location = New System.Drawing.Point(152, 232)
Me.TextBox7.Name = "TextBox7"
Me.TextBox7.Size = New System.Drawing.Size(56, 20)
Me.TextBox7.TabIndex = 13
Me.TextBox7.Text = ""
'
'Button2
'
Me.Button2.BackColor = System.Drawing.Color.LightSkyBlue
Me.Button2.Location = New System.Drawing.Point(256, 232)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 14
Me.Button2.Text = "margin"
'
'TextBox8
'
Me.TextBox8.Location = New System.Drawing.Point(344, 232)
Me.TextBox8.Name = "TextBox8"
Me.TextBox8.Size = New System.Drawing.Size(48, 20)
Me.TextBox8.TabIndex = 15
Me.TextBox8.Text = ""
'
'Button3
'
Me.Button3.BackColor = System.Drawing.Color.LightSkyBlue
Me.Button3.Location = New System.Drawing.Point(456, 232)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 16
Me.Button3.Text = "gen subs"
'
'TextBox9
'
Me.TextBox9.Location = New System.Drawing.Point(544, 232)
Me.TextBox9.Name = "TextBox9"
Me.TextBox9.Size = New System.Drawing.Size(48, 20)
Me.TextBox9.TabIndex = 17
Me.TextBox9.Text = ""
'
'Button4
'
Me.Button4.BackColor = System.Drawing.Color.LightSkyBlue
Me.Button4.Location = New System.Drawing.Point(288, 304)
Me.Button4.Name = "Button4"
Me.Button4.TabIndex = 18
Me.Button4.Text = "clear form"
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(40, 264)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(208, 144)
Me.PictureBox1.TabIndex = 19
Me.PictureBox1.TabStop = False
'
'Label7
'
Me.Label7.Location = New System.Drawing.Point(408, 376)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(224, 23)
Me.Label7.TabIndex = 20
Me.Label7.Text = "jack jones"
Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.RoyalBlue
Me.ClientSize = New System.Drawing.Size(664, 415)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.TextBox9)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.TextBox8)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.TextBox7)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox6)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "lentic margin & substance calculator"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim index As Decimal
Dim power As Decimal
Dim r As Decimal
Dim sag As Decimal
Dim d As Decimal
index = 498
power = TextBox3.Text
r = index / power
d = TextBox4.Text
sag = r - Math.Sqrt(r ^ 2 - (d ^ 2 / 4))
TextBox7.Text = sag

 

 

 

End Sub

 

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim a As Decimal
Dim p As Decimal
Dim edge As Decimal
Dim sag As Decimal
Dim t As Decimal
Dim margin As Decimal
Dim d As Decimal
a = TextBox1.Text
p = TextBox2.Text
d = TextBox4.Text
edge = TextBox5.Text
sag = TextBox7.Text
t = TextBox6.Text
margin = (a ^ 2 * p - 4000 * (edge + sag - t)) / (d ^ 2 - a ^ 2)
TextBox8.Text = margin

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim index As Decimal
Dim power As Decimal
Dim edge As Decimal
Dim front As Decimal
Dim sag As Decimal
Dim d As Decimal
Dim substance As Decimal
Dim r As Decimal
index = 498
power = TextBox8.Text
r = index / power
d = TextBox4.Text
front = TextBox7.Text
edge = TextBox5.Text
sag = r - Math.Sqrt(r ^ 2 - (d ^ 2 / 4))
substance = sag + edge + front
TextBox9.Text = substance
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""

 

End Sub
End Class