Public druck1 As Integer
Public druck2 As Integer
Public temp1 As Integer
Public temp2 As Integer
Public vol1 As Double
Public vol2 As Double
Public druck11 As Long
Public druck22 As Long
Public temp11 As Long
Public temp22 As Long
Public vol11 As Double
Public vol22 As Double
Private Sub Command1_Click()
druck1 = Val(txtdruck1.Text)
druck2 = Val(txtdruck2.Text)
temp1 = Val(txttemp1.Text)
temp2 = Val(txttemp2.Text)
vol1 = Val(txtvol1.Text)
vol2 = Val(txtvol2.Text)
If Option1.Value = True Then
If vol1 5 Then
vol1 = 5
End If
If temp1 > 500 Then
temp1 = 500
ElseIf temp1 500 Then
druck1 = 500
End If
If temp1 500 Then
temp1 = 500
End If
If druck1 = druck2 Then
Command2.Enabled = False
Else: Command2.Enabled = True
End If
If temp1 = temp2 Then
Command2.Enabled = False
Else: Command2.Enabled = True
End If
If optdruck1.Value = True Then
druck11 = (druck2 * temp1) / temp2
txtdruck1.Text = druck11
ElseIf optdruck2.Value = True Then
druck22 = (druck1 * temp2) / temp1
txtdruck2.Text = druck22
End If
If opttemp1.Value = True Then
temp11 = (druck1 * temp2) / druck2
txttemp1.Text = temp11
ElseIf opttemp2.Value = True Then
temp22 = (druck2 * temp1) / druck1
Debug.Print temp22
txttemp2.Text = temp22
End If
End If
If Option3.Value = True Then
If druck1 > 500 Then
druck1 = 500
ElseIf druck1 > 50 Then
druck1 = 50
End If
If vol1 > 5 Then
vol1 = 5
ElseIf vol1 v2 Then
Picture2.Line (60, 100)-(125, 25)
Picture2.Line (60, 100)-(60, 95)
Picture2.Line (60, 100)-(65, 100)
Picture3.Line (60, 60)-(125, 60)
Picture3.Line (60, 60)-(65, 55)
Picture3.Line (60, 60)-(65, 65)
Picture1.Line (60, 60)-(125, 60)
Picture1.Line (60, 60)-(65, 55)
Picture1.Line (60, 60)-(65, 65)
End If
If v1 v2 Then
AniGif1.FileName = "C:\Dokumente und Einstellungen\Robert\Desktop\VBA\gfx\isobar-.gif"
AniGif1.StartRender
End If
ElseIf Option2.Value = True Then
If temp1 temp2 Then
Picture2.Line (60, 60)-(125, 60)
Picture2.Line (60, 60)-(65, 55)
Picture2.Line (60, 60)-(65, 65)
Picture3.Line (60, 100)-(125, 25)
Picture3.Line (60, 100)-(60, 95)
Picture3.Line (60, 100)-(65, 100)
Picture1.Line (100, 25)-(100, 80)
Picture1.Line (100, 80)-(95, 75)
Picture1.Line (100, 80)-(105, 75)
End If
If temp1 temp2 Then
AniGif1.FileName = "C:\Dokumente und Einstellungen\Robert\Desktop\VBA\gfx\isochor-.gif"
AniGif1.StartRender
End If
ElseIf Option3.Value = True Then
If vol1 > vol2 Then
Picture3.Line (100, 25)-(100, 80)
Picture3.Line (100, 25)-(105, 30)
Picture3.Line (100, 25)-(95, 30)
Picture2.Line (100, 25)-(100, 80)
Picture2.Line (100, 80)-(95, 75)
Picture2.Line (100, 80)-(105, 75)
Picture1.Visible = False
Picture4.Visible = True
ElseIf vol1 vol2 Then
AniGif1.FileName = "C:\Dokumente und Einstellungen\Robert\Desktop\VBA\gfx\isotherm+.gif"
AniGif1.StartRender
ElseIf vol1 < vol2 Then
AniGif1.FileName = "C:\Dokumente und Einstellungen\Robert\Desktop\VBA\gfx\isochor-.gif"
AniGif1.StartRender
End If
End If
Form1.Enabled = True
Command2.Enabled = False
End Sub
Private Sub command3_click()
End Sub
Private Sub Form_Load()
optdruck1.Value = True
Command2.Enabled = False
Picture4.Visible = False
End Sub
Private Sub optdruck1_Click()
txtdruck1.Enabled = False
optvol1.Value = False
opttemp1.Value = False
optdruck2.Value = False
optvol2.Value = False
opttemp2.Value = False
txtvol1.Enabled = True
txttemp1.Enabled = True
txtdruck2.Enabled = True
txtvol2.Enabled = True
txttemp2.Enabled = True
End Sub
Private Sub optdruck2_Click()
txtdruck2.Enabled = False
optdruck1.Value = False
opttemp1.Value = False
optvol1.Value = False
optvol2.Value = False
opttemp2.Value = False
txtvol1.Enabled = True
txttemp1.Enabled = True
txtdruck1.Enabled = True
txtvol2.Enabled = True
txttemp2.Enabled = True
End Sub
Private Sub Option1_Click()
optdruck1.Enabled = False
txtdruck1.Enabled = True
optdruck2.Enabled = False
txtdruck2.Enabled = True
opttemp2.Value = True
Picture1.Visible = True
Picture4.Visible = False
optvol1.Enabled = True
txtvol1.Enabled = True
optvol2.Enabled = True
txtvol2.Enabled = True
opttemp1.Enabled = True
txttemp1.Enabled = True
opttemp2.Enabled = True
txttemp2.Enabled = True
txtdruck1.Text = "100"
txtdruck2.Text = "100"
txtvol1.Text = "1,00"
txtvol2.Text = "2,00"
txttemp1.Text = "300"
txttemp2.Text = "600"
End Sub
Private Sub Option2_Click()
optvol1.Enabled = False
txtvol1.Enabled = True
optvol2.Enabled = False
txtvol2.Enabled = True
opttemp2.Value = True
Picture4.Visible = False
Picture1.Visible = True
optdruck1.Enabled = True
txtdruck1.Enabled = True
optdruck2.Enabled = True
txtdruck2.Enabled = True
opttemp1.Enabled = True
txttemp1.Enabled = True
opttemp2.Enabled = True
txttemp2.Enabled = True
txtdruck1.Text = "100"
txtdruck2.Text = "200"
txtvol1.Text = "1,00"
txtvol2.Text = "1,00"
txttemp1.Text = "300"
txttemp2.Text = "600"
End Sub
Private Sub Option3_Click()
opttemp1.Enabled = False
txttemp1.Enabled = True
opttemp2.Enabled = False
txttemp2.Enabled = True
optvol2.Value = True
Picture1.Visible = True
Picture4.Visible = False
optvol1.Enabled = True
txtvol1.Enabled = True
optvol2.Enabled = True
txtvol2.Enabled = True
optdruck1.Enabled = True
txtdruck1.Enabled = True
optdruck2.Enabled = True
txtdruck2.Enabled = True
txtdruck1.Text = "100"
txtdruck2.Text = "200"
txtvol1.Text = "2,00"
txtvol2.Text = "1,00"
txttemp1.Text = "300"
txttemp2.Text = "600"
End Sub
Private Sub opttemp1_Click()
txttemp1.Enabled = False
optdruck1.Value = False
optvol1.Value = False
optdruck2.Value = False
optvol2.Value = False
opttemp2.Value = False
txtvol1.Enabled = True
txtdruck1.Enabled = True
txtdruck2.Enabled = True
txtvol2.Enabled = True
txttemp2.Enabled = True
End Sub
Private Sub opttemp2_Click()
txttemp2.Enabled = False
optdruck1.Value = False
opttemp1.Value = False
optdruck2.Value = False
optvol2.Value = False
optvol1.Value = False
txtvol1.Enabled = True
txttemp1.Enabled = True
txtdruck2.Enabled = True
txtvol2.Enabled = True
txtdruck1.Enabled = True
End Sub
Private Sub optvol1_Click()
txtvol1.Enabled = False
optdruck1.Value = False
opttemp1.Value = False
optdruck2.Value = False
optvol2.Value = False
opttemp2.Value = False
txtdruck1.Enabled = True
txttemp1.Enabled = True
txtdruck2.Enabled = True
txtvol2.Enabled = True
txttemp2.Enabled = True
End Sub
Private Sub optvol2_Click()
txtvol2.Enabled = False
optdruck1.Value = False
opttemp1.Value = False
optdruck2.Value = False
optvol1.Value = False
opttemp2.Value = False
txtvol1.Enabled = True
txttemp1.Enabled = True
txtdruck2.Enabled = True
txtdruck1.Enabled = True
txttemp2.Enabled = True
End Sub
Private Sub Refresh_Click()
AniGif1.Clear
Option1.Value = True
optdruck1.Enabled = False
txtdruck1.Text = "100"
txtvol1.Text = "1,00"
txttemp1.Text = "300"
Picture1.Cls
optdruck2.Enabled = False
txtdruck2.Text = "100"
txtvol2.Text = "2,00"
txttemp2.Text = "600"
opttemp2.Value = True
AniGif1.StopRender
Command1.Enabled = True
Command2.Enabled = False
Picture2.Cls
Picture3.Cls
Picture1.Visible = True
Picture4.Visible = False
End Sub |