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??
ADAdministrator Syncfusion Team June 15, 2005 01:26 PM
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.
DMDuncan McLeodJune 15, 2005 03:12 PM
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?
ADAdministrator Syncfusion Team June 16, 2005 05:34 PM
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.
ADAdministrator Syncfusion Team June 17, 2005 04:13 PM
So there''s no way for me to get the left or right points or client rectangle of the actual combo box?
ADAdministrator Syncfusion Team June 17, 2005 04:22 PM
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.