Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting focus
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01479736
Message ID:
01479955
Vues:
38
Hi Viv.
Tried the Validated event and this does not fire twice so seems to do the trick.
Many thanks for your help.
Regards,
Gerard


>>I have a TextBox on a form , and on the Leave event I have code to call a MessageBox and am getting some unexpected behaviour.
>>
>>e.g.
>>
>>If I have on the Leave event of a textBox: Messagebox.Show("This is a test") , this messagebox displays once.
>>
>>if I have : MessageBox.Show("This is a test"); followed by This.MyOtherControl.Focus(), the Messagebox fires twice. The fact that I have a Focus seems to be firing the 'Leave' event a second time.
>>
>>I would need to do this type of thing quite regulalry i.e. on leaving a control, DO SOMETHING and then set focus to another control. Is the 'Leave' event the best time to do this or is there some other way round the Leave event firing twice ?
>
>I don't remember why this happens but can you use the Validated event instead of the Leave ?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform