I have the following code which is fired by Handles Button1.Click
.
Dim X, Cf As Double
Dim A, B, C, D, J As String
A = TextBox2.Text
B = TextBox3.Text
C = TextBox4.Text
D = TextBox9.Text
J = ComboBox2.Text
If J = "K" Then
If W5() = "K" Then
If A = "" Then : C1() : Else : X = TextBox2.Text : End If
ElseIf W6() = "K" Then
If B = "" Then : C1() : Else : X = TextBox3.Text : End If
ElseIf W7() = "K" Then
If C = "" Then : C1() : Else : X = TextBox4.Text : End If
ElseIf W8() = "K" Then
If D = "" Then : C1() : Else : X = TextBox5.Text : End If
End If
If X <> Nothing Then
Cf = ((X * 78) / 94) / 100
End If
End If
Being C1()
a warning message when the W (5 a 8)
chosen is empty.
My problem is that when W
is empty the MessageBox of C1()
Appears twice, if W
is not empty everything happens as scheduled.
This is the code for my MessageBox:
Public Function C1()
MessageBox.Show("Informe o valor!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Function
Could anyone help me here? C # answers are also accepted.
I apologize to everyone who took some time off to help me, the code was being fired twice, now it's back to normal. Thank you all for the help.