We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How can I get the textbox of the TextBoxBarItem and fire its events?

 

You need to get hold of the internal TextBox in the TextBoxBarItem and you can access the textbox events associated with it. You can do this using the TextBoxItemBound event of the TextBoxBarItem, where you can get the internal textbox from args.TextBox. Please ensure to use the MainFrameBarManager to get this working. Please refer to the following code snippet.

C#

this.textBoxBarItem1.TextBoxItemBound += new Syncfusion.Windows.Forms.Tools.XPMenus.TextBoxItemBoundEventHandler(textBoxBarItem1_TextBoxItemBound);

void textBoxBarItem1_TextBoxItemBound(object sender, Syncfusion.Windows.Forms.Tools.XPMenus.TextBoxItemBoundEventArgs args)

{

TextBox m_textbox = args.TextBox as TextBox;

m_textbox.Validated += new EventHandler(m_textbox_Validated);

}

void m_textbox_Validated(object sender, EventArgs e)

{

Console.WriteLine("Event Fired");

}

VB

Private Sub textBoxBarItem1_TextBoxItemBound(ByVal sender As Object, ByVal args As Syncfusion.Windows.Forms.Tools.XPMenus.TextBoxItemBoundEventArgs) Handles textBoxBarItem1.TextBoxItemBoundAddHandler args.TextBox.Validated, AddressOf TextBox_Validated

AddHandler args.TextBox.LostFocus, AddressOf TextBox_LostFocus

End Sub

Private Sub TextBox_Validated(ByVal sender As Object, ByVal e As EventArgs)

Console.WriteLine("Validated event fired")

End Sub

Sample:

http://help.syncfusion.com/support/samples/Tools.Windows/TextBoxBarItem/Sample_C%23.zip

Article ID: Published Date: Last Revised Date: Platform: Control:
1772 04/30/2011 07/10/2014 Windows Forms XPToolbar
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.