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 to specify the text alignment of the ComboBoxBarItem?

The cursor position of the ComboBoxBarItem is the same on its lost focus, by default. Like the ComboBox, the cursor position of the ComboBoxBarItem can be aligned to the left by handling its events, TextBoxBound, MouseUp, and LostFocus.

 

TextBoxBound:

This event is raised when TextBox bounds in the ComboBarItem is set. By handling this event, you can access its inner TextBox.

MouseUp:

This event is raised once Mouse selection occurs in the ComboBarItem. By handling this event, you can update the cursor position upon selection.

LostFocus:

This event is raised when the ComboBarItem focus is lost. By handling this event, you can update its cursor position once the focus in lost.

The following code example demonstrates the same.

C#

 

VB

 

 

Figure 1: ComboBoxBarItem focused on its item selection

 

Figure 2: ComboBoxBarItem text is left aligned on its focus lost

 

Sample Links:

C#: http://www.syncfusion.com/downloads/support/directtrac/141232/ze/ComboBoxJustify-897526030

VB: http://www.syncfusion.com/downloads/support/directtrac/141232/ze/ComboBoxJustify_VB-574148021

Article ID: Published Date: Last Revised Date: Platform: Control:
5220 07/16/2015 07/16/2015 Windows Forms XPToolbar
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.