Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a message box in Validating method
Message
De
21/04/2004 16:26:51
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Using a message box in Validating method
Divers
Thread ID:
00897016
Message ID:
00897016
Vues:
82
I have noticed strange behaviors with VB.NET.
1. In the Validating method of a textbox place a messagebox command.
2. If the next object you select is a button the validation method of the textbox fires but the click method of the button does not.

Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
MessageBox.Show("Validating")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MessageBox.Show("hello")
End Sub

Also
You have textbox1 with a validating method as above. causesvalidation = true
You have button1 with causesvalidation=false
You have button2 with causesvalidation=true

1. You click into the textbox then into button1 (textbox.validating does not fire) then click into button2 and textbox.validating fires. I did not expect this.

Hope this makes sense. I searched the archives but did not see a similiar problem.

TIA
Robert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform