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.

Width of ComboBoxBarItem

Thread ID:

Created:

Updated:

Platform:

Replies:

30311 Jun 15,2005 01:38 PM Jun 17,2005 05:22 PM Windows Forms 5
loading
Tags: Tools
Duncan McLeod
Asked On June 15, 2005 01:38 PM

This may be a simple thing I am missing but I haven''t figured it out so far... I have a ComboBoxBarItem on an XPMenu. I would like it to extend to the edge of the form. All I can do is set the MinWidth property. But when the form resizes to something smaller, the ComboBoxBarItem dissapears. Basically I need to access it''s width and/or left properties but cannot do so. Is there an easier way to make this control extend to the edge of the bar without dissapearing when the form is resized??

Administrator [Syncfusion]
Replied On June 15, 2005 02:26 PM

Hi Duncan, Unfortunately, the BarItems in XPMenus are not actually controls and therefore don''t have the standard properties you might expect. However, the following code snippet should provide the functionality you want: private void Form1_Resize(object sender, System.EventArgs e) { this.comboBoxBarItem1.MinWidth = this.ClientRectangle.Width - 25; } However, please be advised that this assumes that the ComboBoxBarItem is the only item on the Bar and will need to be adjusted accordingly if there are other BarItems present or customization is active. Hope it helps. Regards, Gregory Austin Syncfusion Inc.

Duncan McLeod
Replied On June 15, 2005 04:12 PM

Hi, Yes, I realize I can do that, but what if I have other controls on the menu bar, which may or may not be shown. I can''t really hard code a value of 25. Is there no way to get the width of these controls??? The other thing is that while the ComboBoxBarItem has focus, pressing the left or right arrow keys, or Home or End, etc... do not function as expected. Focus moves to the previous or next control on the bar. Is there a way to avoid this?

Administrator [Syncfusion]
Replied On June 16, 2005 06:34 PM

Hi Duncan, You could use this.mainFrameBarManager1.GetBarControl(this.bar1).ClientRectangle.Width instead of this.ClientRectangle. However, it will still require that offset, as part of the client is occupied by other objects. Regards, Gregory Austin Syncfusion Inc.

Administrator [Syncfusion]
Replied On June 17, 2005 05:13 PM

So there''s no way for me to get the left or right points or client rectangle of the actual combo box?

Administrator [Syncfusion]
Replied On June 17, 2005 05:22 PM

Hi Duncan, I''m afraid there isn''t a normal way to access the ComboBox. I would assume you would be able to access it by modifying the source code, but otherwise I don''t believe it''s possible. Regards, Gregory Austin Syncfusion Inc.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;