c# - textbox_leave event fires twice when click on combobox -
hi have used textbox_leave method in order validate textbox , if mouse clicked on control want show message box. code shown below.
private void txtbox_leave(object sender, eventargs e) { if(textbox.text != "this") { messagebox.show("not valid"); textbox.focus(); } }
the issue when click on combobox in form messagebox pop twice. if click on other control works fine. how can solve problem?
thanks in advance..
it more appropriate use combobox.selectedindexchanged or combobox.selectedvaluechanged validate value selected user combobox.
Comments
Post a Comment