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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

the menu created have a triangle next to it, how can i remove

Thread ID:

Created:

Updated:

Platform:

Replies:

145451 Jun 22,2019 12:55 PM UTC Jun 24,2019 09:08 AM UTC WinForms 3
loading
Tags: MainFrameBarManager
alex
Asked On June 22, 2019 12:55 PM UTC


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
                });
}

image

Jagadeesan Pichaimuthu [Syncfusion]
Replied On 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. 
  
#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, 
Jagadeesan 


alex
Replied On June 24, 2019 08:57 AM UTC

great. everything make sense now

Jagadeesan Pichaimuthu [Syncfusion]
Replied On 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 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon