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

How do I create a context menu without icons

I''m trying to display a menu that does not have the icons shown along the left side. I''m using the following code: private void lnkChooseSubset_Click(object sender, System.EventArgs e) { Point ClickPoint = new Point(lnkChooseSubset.Right, lnkChooseSubset.Top); // Convert to Screen coordinates Point ScreenPoint = this.pnlSummary.PointToScreen(ClickPoint); // Convert from Screen coordinates to Form coordinates Point FormPoint = this.PointToClient(ScreenPoint); // Show subset context menu parentBarItem1.Items.Clear(); parentBarItem1.PaintStyle = PaintStyle.TextOnly; for (int i = 1; i < 10; i++) { BarItem pNew=new BarItem(); pNew.Text="Label - " + i.ToString(); pNew.Tag="Label" + i.ToString(); pNew.Click+=new EventHandler(PopItem_Click); pNew.ProvideFontInfo+=new ProvideFontInfoEventHandler(pNew_ProvideFontInfo); pNew.PaintStyle = PaintStyle.TextOnly; parentBarItem1.Items.Add(pNew); } popHomePageSubset.Show(this,FormPoint); } Note that I''ve set the PaintStyle to "TextOnly" and it does not work. Setting it to anything makes no difference...I always see a white vertical stripe down the left side of my menu whose background color is blue. What might I be doing wrong?

1 Reply

AD Administrator Syncfusion Team October 21, 2004 06:01 PM UTC

Hi, Please refer to the test sample attached that shows how you could have a PopupMenu with BarItems in PaintStyle.TextOnly mode. If you are referring to the long vertical rectangle on the left side of the PopupMenu, then I would like to inform you that this is done by design intent and not a result of a bug in the BarItem''s PaintStyle property. Our XPMenus framework is closely modelled on the VS.NET''s menus and we have maintained similar behavior/look and feel for consistency purposes. If you are using Office2003 VisualStyle for the menus, this is exactly how the MS Office 2003 context menu looks too. Let me know if I have not understood your problem correctly. We appreciate your cooperation. Regards, Guru Patwal Syncfusion, Inc.

Live Chat Icon For mobile
Up arrow icon