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. Image for the cookie policy date

CommandBarController doesn''t work properly with MenuStrip

Hi, I have an application where I use System.Windows.Forms.MainMenu and Syncfusion.Windows.Forms.Tools.CommandBarController (version 3.3.0.0). This combination works fine. However, we are going to move to use VisualStudio 2005 and this version provides a new menu control(System.Windows.Forms.MenuStrip). It seems, that CommandBarController does not work properly with MenuStrip: It moves the Menustrip from its "natural position" (see attached file). OK, it is possible that the MenuStrip is put into a commandbar but I would like that the menu is "locked" top of the form in a way that a user cannot drag it. What can I do? Can I use the MenuStrip with the CommandBarController at all?

cmbBar.zip

1 Reply

MJ Mano J Syncfusion Team January 3, 2006 10:26 AM UTC

Hi Semu, This is because of Microsoft bug in .Net Framework 2.0 with MenuStrip. I have attached a sample that demonstrates this issue in .Net Framework: there is MyComponent, that supports ISupportInitialize interface, and MenuStrip with some items. In MyComponent.EndInit() method, a button is added to Hosted Form''s controls, and set DockStyle.Top to that button. You can see the same appearance. SampleComponent.zip We already have an open bug report logged regarding this issue:: CommandBar occupies topmost part of form when used with windows Menu Control in VS 2005. As a workaround, you could follow the steps below to use the CommandBarController along with MenuStrip: 1. Add a commandBarController component to the form. 2. Create a commandBar by right clicking on the commandBarController component. 3. Set the following properties to true for ''CommandBar1''. a) HideChevron b) HideCloseButton c) HideDropDownButton d) HideGripper - (This will remove the gripper at the left side of commandBar so that the user cannot drag it.) 4. Add a panel to commandBar1. 5. Now Drag and Drop ''MenuStrip'' control into the panel. (The MenuStrip will now appear in the top) 6. You can then add any more commandBars using the normal procedure. I have attached a sample that shows this workaround completely. Please refer to it and let me know if this meets your requirements. We appreciate your feedback and thank you for using Syncfusion products. Regards, Mano MenuStrip_CommandBar.zip

Loader.
Live Chat Icon For mobile
Up arrow icon