Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

In my VB.Net form, I'm trying to create an event (leave event)for a custom text field. I'll have to raise the event when the focus is leaving the textbox. It displays in the event list but doesnot fire when I want to, like leaving the textfield. Please help me with this.

My custom textbox class has this event:
Public Event TextBoxControl_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)


I'd really really appreciate your help.

Thanks

Raj
Posted
Updated 21-Jul-14 17:45pm

1 solution

Is this a custom control you are using?

If you have the control source, you can look up the RaiseEvent handler and see if it points correctly to the TextBoxControl_Leave event.

If nothing works - you can always use the Enter property of other controls to accomplish what you are trying to achieve.
 
Share this answer
 
Comments
Member 7894058 22-Jul-14 20:19pm    
Hi,
Thanks very much for you reply. It is a custom control (inherited from WPF in winform). Actually, the event displays in the event in the design view of the form, but does not fire it.
Private Sub SpellBox2_TextBoxControl_Leave(sender As Object, e As EventArgs) Handles SpellBox2.TextBoxLeave
Me.SpellBox2.Text = SpellBox2.Text.Trim
End Sub
I'd really appreciate if you could kindly provide me a code sample to go around it. I'm really stuck it that.

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900