the menu created have a triangle next to it, how can i remove
Dear all,
Why there is an down triangle next to each menu item, how can i remove it ?
Another thing i want to ask is what is the correct control i need to use to make a simple main menu ? Windows control has a menustrip which you can make menu. But syncfusion do have it.
i create the menu by code because i cannot make it by using designer.
private void SetupMenu()
{
this.mainFrameBarManager1.Style = Syncfusion.Windows.Forms.VisualStyle.Office2007;
// Add MainFrameBarManager as Manager
bar1.BarName = "MainMenu";
bar1.Caption = "Main Menu";
bar1.Manager = mainFrameBarManager1;
// Add Bar and Categories
mainFrameBarManager1.Bars.Add(bar1);
mainFrameBarManager1.Categories.Add("File");
// set caption
parentBarItemFile.Text = "File";
barItem1.Text = "New";
barItem2.Text = "Open";
barItem3.Text = "Save";
parentBarItemEdit.Text = "Edit";
parentBarItemWindow.Text = "Window";
parentBarItemHelp.Text = "Help";
// Add it to MainFrameBarManager
mainFrameBarManager1.Items.AddRange(
new BarItem[] {
parentBarItemFile, barItem1, barItem2, barItem3,
parentBarItemEdit,
parentBarItemWindow,
parentBarItemHelp
});
// Add BarItem to ParentBarItem
parentBarItemFile.Items.AddRange(new BarItem[] { barItem1, barItem2, barItem3 });
// Add ParentBarItem to Bar
bar1.Items.AddRange(
new BarItem[] {
parentBarItemFile,
parentBarItemEdit,
parentBarItemWindow,
parentBarItemHelp
});
}
SIGN IN To post a reply.
3 Replies
JP
Jagadeesan Pichaimuthu
Syncfusion Team
June 24, 2019 08:36 AM UTC
Hi Alex,
Thanks for using Syncfusion product.
We have analyzed the reported query “How to remove the triangle arrow next to bar items in Menu control”. By default, the triangle arrow is rendered for the parent bar item types based on the BarStyle property. If you want to achieve the reported requirement, you can add the IsMainMenu type in bar styles options. Now the triangle arrow doesn’t shown in the menu item, that is similar to MenuStrip control.
Please refer the following code sample.
Thanks for using Syncfusion product.
We have analyzed the reported query “How to remove the triangle arrow next to bar items in Menu control”. By default, the triangle arrow is rendered for the parent bar item types based on the BarStyle property. If you want to achieve the reported requirement, you can add the IsMainMenu type in bar styles options. Now the triangle arrow doesn’t shown in the menu item, that is similar to MenuStrip control.
Please refer the following code sample.
|
#Form1.cs
private void InitializeComponent()
{
this.mainFrameBarManager1.Bars.Add(this.bar1);
this.mainFrameBarManager1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
this.parentBarItem1,
this.barItem1,
this.barItem2
});
this.bar1.BarName = "MainMenu";
this.bar1.Caption = "MainMenu";
this.bar1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
this.parentBarItem1
});
this.bar1.BarStyle = ((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle)(((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.AllowQuickCustomizing | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.IsMainMenu)
| Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.Visible)));
this.bar1.Manager = this.mainFrameBarManager1;
this.parentBarItem1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
this.barItem1,
this.barItem2});
this.parentBarItem1.Text = "File";
this.barItem1.Text = "New";
this.barItem2.Text = "Open";
}
|
Please let us know if you need any further assistance.
Regards,
Regards,
Jagadeesan
AL
alex
June 24, 2019 08:57 AM UTC
great. everything make sense now
JP
Jagadeesan Pichaimuthu
Syncfusion Team
June 24, 2019 09:08 AM UTC
Hi Alex,
Thanks for your update.
We are glad to know that the provided solution worked at your end. Please let us know if you have any further queries on this. We are happy to help you.
Regards,
Jagadeesan
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AL alex
- Jun 22, 2019 12:55 PM UTC
- Jun 24, 2019 09:08 AM UTC