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
close icon

XPMenus: changing main menu

Is there an easy way to change at runtime which bar MainFrameBarManager treats as the main menu? I would like to construct a couple of menus and change them. MainMenuBar is a read-only property.

3 Replies

MJ Mano J Syncfusion Team November 18, 2005 09:57 AM UTC

Hi Jim, You could use BarStyle property to change bar''s MainMenu. Say, if bar1 is the Main bar and bar2 is another bar, then you could change the bar2 to MainMenu as follows, // Set bar2 as Main menu this.bar2.BarStyle = BarStyle.IsMainMenu ; this.bar1.BarStyle = BarStyle.Visible; // Set the RowIndex of MainMenu to zero. this.mainFrameBarManager1.GetBarControl(this.bar2).RowIndex = 0; this.mainFrameBarManager1.GetBarControl(this.bar1).RowIndex = 2; Please let me know if you have any questions. Regards, Mano


JI Jim November 21, 2005 02:52 AM UTC

Couldn''t get this to work. I want to hide on menu and show another. As you know, I''m giving up on XPMenus and going with a competitor''s product anyway. Thanks for trying to help.


MJ Mano J Syncfusion Team November 22, 2005 10:18 AM UTC

Hi Jim, If you want to make a bar as a MainMenu and hide all other menus, you should associate the BarStyle of the bar to MainMenu and set the BarStyle of other menus to be none. private void button1_Click(object sender, System.EventArgs e) { this.bar1.BarStyle = BarStyle.None; this.bar2.BarStyle = BarStyle.IsMainMenu; } private void button2_Click(object sender, System.EventArgs e) { this.bar2.BarStyle = BarStyle.None; this.bar1.BarStyle = BarStyle.IsMainMenu; } Please let me know if this meets your requirements. I have attached a sample that illustrates this issue. Regards, Mano Sample.zip

Loader.
Live Chat Icon For mobile
Up arrow icon