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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ParentBarItem and CloseOnClick property

Thread ID:





57214 Feb 27,2007 09:25 PM UTC Mar 29,2007 07:43 PM UTC WinForms 5
Tags: Tools
Asked On February 27, 2007 09:25 PM UTC

The documentation contains a great example of how this property can be used to create a menu containing BarItems that can be checked.

However, what if I want to mix checkable items with items that behave normally (i.e. they close the menu when they are clicked)?

Below i have extended the example to illustrate my point...

private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
PopupMenu popup = new PopupMenu();
ParentBarItem parentItem = new ParentBarItem();
parentItem.CloseOnClick = false;

barItem1.Checked = true;
barItem1.Click += new EventHandler(ItemChecked);
barItem2.Click += new EventHandler(ItemClicked);


popup.ParentBarItem = parentItem;
popup.Show(this, new Point(e.X, e.Y));
private void ItemChecked(object sender, EventArgs e)
BarItem itemClicked = sender as BarItem;
itemClicked.Checked = !itemClicked.Checked;
private void ItemClicked(object sender, EventArgs e)
// Perform Action...


Golda Rebecal [Syncfusion]
Replied On February 28, 2007 02:28 PM UTC

Hi Nik,

We can use the Hide method of the PopupMenu to avoid showing the popup after an item is clicked.

Please have a look at the attached sample and let me know if this meets your requirement.

Thanks for your interest in Syncfusion products.

Best Regards,


Replied On March 1, 2007 10:46 PM UTC

Thanks for your example. Unfortunately it doesn't solve my problem :(

I should have been more explicit - the BarItems on which I require this behaviour are part of a ChildFrameBarManager. So they are shown via a MENU or a TOOLBAR rather than a PopupMenu.

Thanks for your continued assistance.


Golda Rebecal [Syncfusion]
Replied On March 5, 2007 02:31 PM UTC

Hi Nik,

With the current implementation, when we set the CloseOnClick property to false for a parentbaritem that is hosted on a main menu or toolbar, it is not possible to close the popup menu.

Please let me know if you have any other questions.

Thanks for your interest in Syncfusion products.

Best Regards,

Golda Rebecal [Syncfusion]
Replied On March 12, 2007 11:49 AM UTC

Hi Nik,

Sorry for the wrong update that I posted earlier.

It is possible to close the popup menu when a particular child baritem is clicked and not for other by using the CloseOnClick property of the ParentBarItem.

Please have a look at the attached sample and let me know if you need any further assistance.

Thanks for your interest in syncfusion products.


Best Regards,

Replied On March 29, 2007 07:43 PM UTC

That's great! Thanks for your help


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