Vous êtes sur la page 1sur 15

Codes for first form

Public Class MenuForm


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True Then
Me.Hide()
Langelier_Saturation_Calculation.ClearPrevData()
Langelier_Saturation_Calculation.ShowDialog()
Me.Show()
ElseIf RadioButton2.Checked Then
Me.Hide()
Ryznar_Saturation_Index.ClearPrevData()
Ryznar_Saturation_Index.ShowDialog()
Me.Show()
ElseIf RadioButton3.Checked Then
Me.Hide()
Stiff_and_Davis__Saturation_Index.ClearPrevData()
Stiff_and_Davis__Saturation_Index.ShowDialog()
Me.Show()
End If
End Sub
Private Sub RadioButton1_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles RadioButton1.KeyPress, RadioButton2.KeyPress,
RadioButton3.KeyPress
If e.KeyChar = Chr(13) Then
Button1.PerformClick()
End If
End Sub
Private Sub RadioButton1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
RadioButton1.MouseEnter
DecolorRadios()
RadioButton1.BackColor = Color.Black()
RadioButton1.ForeColor = Color.Gray
End Sub
Private Sub RadioButton2_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
RadioButton2.MouseEnter
DecolorRadios()
RadioButton2.BackColor = Color.Black()
RadioButton2.ForeColor = Color.Gray
End Sub
Private Sub RadioButton3_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
RadioButton3.MouseEnter
DecolorRadios()
RadioButton3.BackColor = Color.Black()
RadioButton3.ForeColor = Color.Gray
End Sub
Private Sub RadioButton1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
RadioButton1.MouseLeave, RadioButton2.MouseLeave, RadioButton3.MouseLeave
DecolorRadios()
End Sub
Private Sub DecolorRadios()
RadioButton1.BackColor = Color.Gray
RadioButton1.ForeColor = Color.Black
RadioButton2.BackColor = Color.Gray
RadioButton2.ForeColor = Color.Black
RadioButton3.BackColor = Color.Gray
RadioButton3.ForeColor = Color.Black
End Sub
End Class

Design for first form

Codes for second form


Public Class Langelier_Saturation_Calculation
Public pHs As Double
Public LSI As Double
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Me.Close()
MenuForm.Show()
End Sub
Private Function getLSI(ByVal pH As Double, ByVal pHs As Double) As Double
Return pH - pHs
End Function
Private Function getPHS(ByVal A As Double, ByVal B As Double, ByVal C As Double, ByVal D As
Double) As Double
Return ((9.3 + A + B) - (C + D))
End Function
Private Function getA() As Double
Return Math.Round(((Math.Log10(Val(TDS_Box.Text)) - 1) / 10), 3)
End Function
Private Function getB() As Double

Return Math.Round((-13.12 * Math.Log10((Temp_Box.Text) + 273) + 34.55), 3)


End Function
Private Function getC() As Double
Return Math.Round((Math.Log10(Ca2_Box.Text) - 0.4), 3)
End Function
Private Function getD() As Double
Return Math.Round(Math.Log10(Val(CaCo_Box.Text)), 3)
End Function
Private Sub ShowMsg(ByVal LsiValue As Double)
Dim Msg As String = ""
If (LsiValue > -2.0 And LsiValue < -0.5) Then
Msg = "CaCO3 Serious corrosion"
ElseIf (LsiValue < 0.0 And LsiValue > -0.5) Then
Msg = "CaCO3 Slightly corrosion but non-scale forming"
ElseIf (LsiValue = 0.0) Then
Msg = "CaCO3 Balanced but pitting corrosion possible"
ElseIf (LsiValue > 0.0 And LsiValue < 0.5) Then
Msg = "CaCO3 Slightly scale forming and corrosion"
ElseIf (LsiValue > 0.5 And LsiValue < 2) Then
Msg = "CaCO3 scale forming but non corrosive"
End If
MsgBox(Msg, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "pHs is " + pHs.ToString +
" :: LSI is " + LsiValue.ToString)
End Sub
Private Function isInputValid() As Boolean
Dim validFlag As Boolean = True
If Not IsNumeric(pH_Box.Text) Then
pH_Box.Clear()
pH_Box.Focus()
validFlag = False
End If
If Not IsNumeric(Temp_Box.Text) Then
Temp_Box.Clear()
Temp_Box.Focus()
validFlag = False
End If
If Not IsNumeric(TDS_Box.Text) Then
TDS_Box.Clear()
TDS_Box.Focus()
validFlag = False
End If
If Not IsNumeric(Ca2_Box.Text) Then
Ca2_Box.Clear()
Ca2_Box.Focus()
validFlag = False
End If
If Not IsNumeric(CaCo_Box.Text) Then
CaCo_Box.Clear()
CaCo_Box.Focus()
validFlag = False
End If
Return validFlag
End Function

Public Sub ClearPrevData()

pH_Box.Clear()
Temp_Box.Clear()
TDS_Box.Clear()
Ca2_Box.Clear()
CaCo_Box.Clear()
LSI_Box.Clear()
pHs_Box.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
If isInputValid() Then
pHs = getPHS(getA, getB, getC, getD)
LSI = getLSI(Val(pH_Box.Text), pHs)
pHs_Box.Text = pHs
LSI_Box.Text = LSI
ShowMsg(LSI)
Else
MsgBox("Warning : Only numbers are allowed!", MsgBoxStyle.Exclamation +
MsgBoxStyle.OkOnly, "Incorrect input")
End If
End Sub
Private Sub pH_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles pH_Box.KeyPress
If e.KeyChar = Chr(13) Then
Temp_Box.Focus()
End If
End Sub
Private Sub Temp_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Temp_Box.KeyPress
If e.KeyChar = Chr(13) Then
TDS_Box.Focus()
End If
End Sub
Private Sub TDS_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TDS_Box.KeyPress
If e.KeyChar = Chr(13) Then
Ca2_Box.Focus()
End If
End Sub
Private Sub Ca2_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Ca2_Box.KeyPress
If e.KeyChar = Chr(13) Then
CaCo_Box.Focus()
End If
End Sub
Private Sub CaCo_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles CaCo_Box.KeyPress
If e.KeyChar = Chr(13) Then
Button1.PerformClick()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
ClearPrevData()
End Sub
End Class

Design for second form

Codes for third form


Public Class Ryznar_Saturation_Index
Dim pHs As Double
Dim LSI As Double
Dim RI As Double
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Me.Close()
MenuForm.Show()
End Sub
Private Function getRI(ByVal pH As Double, ByVal LSI As Double) As Double
Return (pH - (2 * LSI))
End Function
Private Function getLSI(ByVal pH As Double, ByVal pHs As Double) As Double
Return pH - pHs
End Function
Private Function getPHS(ByVal A As Double, ByVal B As Double, ByVal C As Double, ByVal D As
Double) As Double
Return ((9.3 + A + B) - (C + D))
End Function
Private Function getA() As Double

Return Math.Round(((Math.Log10(Val(TDS_Box.Text)) - 1) / 10), 3)


End Function
Private Function getB() As Double
Return Math.Round((-13.12 * Math.Log10((Temp_Box.Text) + 273) + 34.55), 3)
End Function
Private Function getC() As Double
Return Math.Round((Math.Log10(Ca2_Box.Text) - 0.4), 3)
End Function
Private Function getD() As Double
Return Math.Round(Math.Log10(Val(CaCo_Box.Text)), 3)
End Function
Private Sub ShowMsg(ByVal RI As Double)
Dim Msg As String = ""
If (RI < 5.5) Then
Msg = "Heavy scale likely to form"
ElseIf (RI > 5.5 And RI < 6.2) Then
Msg = "Moderate scale likely to form"
ElseIf (RI > 6.2 And RI < 6.8) Then
Msg = "Water is considered neutral"
ElseIf (RI > 6.8 And RI < 8.5) Then
Msg = "Water is aggessive and corrosion is likely"
ElseIf (RI > 8.5) Then
Msg = "Water is considered very aggressive, and substantial corrosion is possible"
End If
MsgBox(Msg, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "pHs is " + pHs.ToString +
" :: RI is " + RI.ToString)
End Sub
Private Function isInputValid() As Boolean
Dim validFlag As Boolean = True
If Not IsNumeric(pH_Box.Text) Then
pH_Box.Clear()
pH_Box.Focus()
validFlag = False
End If
If Not IsNumeric(Temp_Box.Text) Then
Temp_Box.Clear()
Temp_Box.Focus()
validFlag = False
End If
If Not IsNumeric(TDS_Box.Text) Then
TDS_Box.Clear()
TDS_Box.Focus()
validFlag = False
End If
If Not IsNumeric(Ca2_Box.Text) Then
Ca2_Box.Clear()
Ca2_Box.Focus()
validFlag = False
End If

If Not IsNumeric(CaCo_Box.Text) Then


CaCo_Box.Clear()
CaCo_Box.Focus()
validFlag = False
End If
Return validFlag

End Function
Public Sub ClearPrevData()
pH_Box.Clear()
Temp_Box.Clear()
TDS_Box.Clear()
Ca2_Box.Clear()
CaCo_Box.Clear()
RI_Box.Clear()
pHs_Box.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
If isInputValid() Then
pHs = getPHS(getA, getB, getC, getD)
LSI = getLSI(Val(pH_Box.Text), pHs)
RI = getRI(Val(pH_Box.Text), LSI)
pHs_Box.Text = pHs
RI_Box.Text = RI
ShowMsg(RI)
Else
MsgBox("Warning : Only numbers are allowed!", MsgBoxStyle.Exclamation +
MsgBoxStyle.OkOnly, "Incorrect input")
End If
End Sub
Private Sub pH_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles pH_Box.KeyPress
If e.KeyChar = Chr(13) Then
Temp_Box.Focus()
End If
End Sub
Private Sub Temp_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Temp_Box.KeyPress
If e.KeyChar = Chr(13) Then
TDS_Box.Focus()
End If
End Sub
Private Sub TDS_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TDS_Box.KeyPress
If e.KeyChar = Chr(13) Then
Ca2_Box.Focus()
End If
End Sub
Private Sub Ca2_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Ca2_Box.KeyPress
If e.KeyChar = Chr(13) Then
CaCo_Box.Focus()
End If
End Sub
Private Sub CaCo_Box_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles CaCo_Box.KeyPress
If e.KeyChar = Chr(13) Then
Button1.PerformClick()
End If
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button3.Click
ClearPrevData()
End Sub
End Class

Design for third form

Codes for forth form


Public Class Stiff_and_Davis__Saturation_Index
Dim ionsChargeNumbers() As Double = {1.0, 1.0, 2.0, 2.0, 2.0, 2.0, -1.0, -1.0, -1.0, -2.0}

Dim MolerMass() As Double = {23.0, 39.0, 40.0, 24.0, 131.0, 87.6, 35.5, 19.0, 61.0, 97.0}
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Me.Close()
End Sub
Public Sub ClearPrevData()
Box1.Clear()
Box1On1.Clear()
Box2.Clear()
Box2On2.Clear()
Box3.Clear()
Box3On3.Clear()
Box4.Clear()
Box4On4.Clear()
Box5.Clear()
Box5On5.Clear()
Box6.Clear()
Box6On6.Clear()
Box7.Clear()
Box7On7.Clear()
Box8.Clear()
Box8On8.Clear()
Box9.Clear()
Box9On9.Clear()
Box10.Clear()
Box10On10.Clear()
Box11.Clear()
Box12.Clear()
Box13.Clear()
Box14.Clear()
K_Box.Clear()
pHs_Box.Clear()
SDSI_Box.Clear()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
ClearPrevData()
End Sub

Private Sub Convert_To_Mol_per_L(ByVal Mg_per_L As Double, ByVal BoxPos As Integer)


Dim Mol_per_L As Double = Math.Round(Mg_per_L / (1000 * MolerMass(BoxPos - 1)), 5)
Select Case BoxPos
Case 1
Box1On1.Text = Mol_per_L
Case 2
Box2On2.Text = Mol_per_L

Case 3
Box3On3.Text = Mol_per_L
Case 4
Box4On4.Text = Mol_per_L
Case 5
Box5On5.Text = Mol_per_L
Case 6
Box6On6.Text = Mol_per_L
Case 7
Box7On7.Text = Mol_per_L
Case 8
Box8On8.Text = Mol_per_L
Case 9
Box9On9.Text = Mol_per_L
Case 10
Box10On10.Text = Mol_per_L
Case Else
MsgBox("Error : Please check all input are correct")
End Select
End Sub
Private Function getTotalCZ2() As Double
Dim TotalCZ2 As Double = 0.0
TotalCZ2 += Val(Box1On1.Text) * Math.Pow(ionsChargeNumbers(0), 2)
TotalCZ2 += Val(Box2On2.Text) * Math.Pow(ionsChargeNumbers(1), 2)
TotalCZ2 += Val(Box3On3.Text) * Math.Pow(ionsChargeNumbers(2), 2)
TotalCZ2 += Val(Box4On4.Text) * Math.Pow(ionsChargeNumbers(3), 2)
TotalCZ2 += Val(Box5On5.Text) * Math.Pow(ionsChargeNumbers(4), 2)
TotalCZ2 += Val(Box6On6.Text) * Math.Pow(ionsChargeNumbers(5), 2)
TotalCZ2 += Val(Box7On7.Text) * Math.Pow(ionsChargeNumbers(6), 2)
TotalCZ2 += Val(Box8On8.Text) * Math.Pow(ionsChargeNumbers(7), 2)
TotalCZ2 += Val(Box9On9.Text) * Math.Pow(ionsChargeNumbers(8), 2)
TotalCZ2 += Val(Box10On10.Text) * Math.Pow(ionsChargeNumbers(9), 2)
Return TotalCZ2
End Function
Private Function getI() As Double
Return 0.5 * getTotalCZ2()
End Function
Private Function getK(ByVal I As Double) As Double
Dim K As Double = 0.0
If (I < 1.2) Then
K = 2.022 * Math.E * ((Math.Pow((Math.Log(I) + 7.544), 2)) / 102.6) - 0.0002 *
Math.Pow(Val(Box12.Text), 2) + 0.00097 * Val(Box12.Text) + 0.262
ElseIf I > 1.2 Then
K = (0.1 * I) - (0.0002 * Math.Pow(Val(Box12.Text), 2)) - (0.00097 * Val(Box12.Text)) +
3.887
End If
Return K
End Function
Private Function getpCa()
Return Math.Log(1 / Val(Box3On3.Text))
End Function
Private Function getPalk()
Return Math.Log(1 / Val(Box13.Text))
End Function
Private Function getSI()
Return Val(Box11.Text) - getpCa() - getPalk() - getK(getI)

End Function
Private Function getpHs()
Return getpCa() - getPalk()
End Function
Private Sub ShowMsg(ByVal SI As Double)
Dim Msg As String = ""
If SI >= 0.0 Then
Msg = "The water is SuperSaturated and scale is expected to precipitate"
ElseIf SI < 0.0 Then
Msg = "The scaling is Unlikely"
End If
MsgBox(Msg, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Results")
End Sub
Private Sub Box1_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box1.KeyUp
Convert_To_Mol_per_L(Val(Box1.Text), 1)
End Sub
Private Sub Box2_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box2.KeyUp
Convert_To_Mol_per_L(Val(Box2.Text), 2)
End Sub
Private Sub Box3_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box3.KeyUp
Convert_To_Mol_per_L(Val(Box3.Text), 3)
End Sub
Private Sub Box4_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box4.KeyUp
Convert_To_Mol_per_L(Val(Box4.Text), 4)
End Sub
Private Sub Box5_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box5.KeyUp
Convert_To_Mol_per_L(Val(Box5.Text), 5)
End Sub
Private Sub Box6_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box6.KeyUp
Convert_To_Mol_per_L(Val(Box6.Text), 6)
End Sub
Private Sub Box7_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box7.KeyUp
Convert_To_Mol_per_L(Val(Box7.Text), 7)
End Sub
Private Sub Box8_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box8.KeyUp
Convert_To_Mol_per_L(Val(Box8.Text), 8)
End Sub
Private Sub Box9_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box9.KeyUp
Convert_To_Mol_per_L(Val(Box9.Text), 9)
End Sub
Private Sub Box10_KeyUp(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Box10.KeyUp
Convert_To_Mol_per_L(Val(Box10.Text), 10)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
If isInputValid() Then

Box14.Text = Math.Round(getI(), 5)
K_Box.Text = Math.Round(getK(getI), 5)
pHs_Box.Text = Math.Round(getpHs(), 5)
SDSI_Box.Text = Math.Round(getSI(), 5)
ShowMsg(getSI)
Else
MsgBox("Warning : Only numbers are allowed !please check your inputs")
End If
End Sub
Private Sub Box1_KeyPress(ByVal sender As System.Object, ByVal
System.Windows.Forms.KeyPressEventArgs) Handles Box1.KeyPress
If e.KeyChar = Chr(13) Then
Box2.Focus()
End If
End Sub
Private Sub Box2_KeyPress(ByVal sender As System.Object, ByVal
System.Windows.Forms.KeyPressEventArgs) Handles Box2.KeyPress
If e.KeyChar = Chr(13) Then
Box3.Focus()
End If
End Sub
Private Sub Box3_KeyPress(ByVal sender As System.Object, ByVal
System.Windows.Forms.KeyPressEventArgs) Handles Box3.KeyPress
If e.KeyChar = Chr(13) Then
Box4.Focus()
End If
End Sub
Private Sub Box4_KeyPress(ByVal sender As System.Object, ByVal
System.Windows.Forms.KeyPressEventArgs) Handles Box4.KeyPress
If e.KeyChar = Chr(13) Then
Box5.Focus()
End If
End Sub
Private Sub Box5_KeyPress(ByVal sender As System.Object, ByVal
System.Windows.Forms.KeyPressEventArgs) Handles Box5.KeyPress
If e.KeyChar = Chr(13) Then
Box6.Focus()
End If
End Sub
Private Sub Box6_KeyPress(ByVal sender As System.Object, ByVal
System.Windows.Forms.KeyPressEventArgs) Handles Box6.KeyPress
If e.KeyChar = Chr(13) Then
Box7.Focus()
End If
End Sub

e As

e As

e As

e As

e As

e As

Private Sub Box7_KeyPress(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles Box7.KeyPress
If e.KeyChar = Chr(13) Then
Box8.Focus()
End If
End Sub
Private Sub Box8_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Box8.KeyPress
If e.KeyChar = Chr(13) Then

Box9.Focus()
End If
End Sub
Private Sub Box9_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Box9.KeyPress
If e.KeyChar = Chr(13) Then
Box10.Focus()
End If
End Sub
Private Sub Box10_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Box10.KeyPress
If e.KeyChar = Chr(13) Then
Box11.Focus()
End If
End Sub
Private Sub Box11_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Box11.KeyPress
If e.KeyChar = Chr(13) Then
Box12.Focus()
End If
End Sub
Private Sub Box12_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Box12.KeyPress
If e.KeyChar = Chr(13) Then
Box13.Focus()
End If
End Sub
Private Sub Box13_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Box13.KeyPress
If e.KeyChar = Chr(13) Then
Button1.PerformClick()
End If
End Sub
Private Function isInputValid() As Boolean
Dim validFlag As Boolean = True
If Not IsNumeric(Box1.Text) Then
Box1.Clear()
Box1.Focus()
validFlag = False
End If
If Not IsNumeric(Box2.Text) Then
Box2.Clear()
Box2.Focus()
validFlag = False
End If

If Not IsNumeric(Box3.Text) Then


Box3.Clear()
Box3.Focus()
validFlag = False
End If
If Not IsNumeric(Box4.Text) Then
Box4.Clear()
Box4.Focus()
validFlag = False

End If
If Not IsNumeric(Box5.Text) Then
Box5.Clear()
Box5.Focus()
validFlag = False
End If
If Not IsNumeric(Box6.Text) Then
Box6.Clear()
Box6.Focus()
validFlag = False
End If
If Not IsNumeric(Box7.Text) Then
Box7.Clear()
Box7.Focus()
validFlag = False
End If
If Not IsNumeric(Box8.Text) Then
Box8.Clear()
Box8.Focus()
validFlag = False
End If
If Not IsNumeric(Box9.Text) Then
Box9.Clear()
Box9.Focus()
validFlag = False
End If
If Not IsNumeric(Box10.Text) Then
Box10.Clear()
Box10.Focus()
validFlag = False
End If
If Not IsNumeric(Box11.Text) Then
Box11.Clear()
Box11.Focus()
validFlag = False
End If
If Not IsNumeric(Box12.Text) Then
Box12.Clear()
Box12.Focus()
validFlag = False
End If
If Not IsNumeric(Box13.Text) Then
Box13.Clear()
Box13.Focus()
validFlag = False
End If
Return validFlag
End Function
End Class

Codes for forth form

Vous aimerez peut-être aussi