Na formi imam dva Button-a i jedat TextBox. Oba rade istu stvar, tj. zatvaraju formu
Code:
Me.Close()
Me.Close()
Prvo dugme ima CauseValidation = False, drugo CauseValidation = True.
TextBox ima sledeci kod :
Code:
Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
Dim Boxic As TextBox = DirectCast(sender, Control)
If Boxic.Text = "" Then
MsgBox("GRESKA")
GoTo Greska
End If
GoTo Kraj
Greska:
e.Cancel = True
Kraj:
End Sub
Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
Dim Boxic As TextBox = DirectCast(sender, Control)
If Boxic.Text = "" Then
MsgBox("GRESKA")
GoTo Greska
End If
GoTo Kraj
Greska:
e.Cancel = True
Kraj:
End Sub
Bez obzira koje dugme pritisnem, ja ne mogu izaci iz TextBoxa.
Da li to sa CauseValidation uopste radi.