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

ToolStripPanelItem

I am trying to set Office Mode properties at runtime. I have a ToolStripEx with ToolStripPanelItem's which each contains a ToolStripButton. I would like to be able to toggle the GroupedButtons state. I am iterating through the ControlsCollection and attempting to do this as follows:
if (cntl.GetType() == typeof(Syncfusion.Windows.Forms.Tools.ToolStripPanelItem))
((Syncfusion.Windows.Forms.Tools.ToolStripPanelItem)cntl).GroupedButtons = state;

However the GetType() never sees a ToolStripPanelItem in the ControlsCollection. It does find ToolStripEx and ToolStripInternal controls however.

Thanks


3 Replies

AD Administrator Syncfusion Team August 26, 2008 12:03 PM UTC

Hi,

Thank you for your interest in Syncfusion Products.

You could try the following code to retrieve the ToolStripPanelItem's during runtime.

[C#]
foreach(ToolStripItem p in toolStripEx1.Items)
{
if (p is ToolStripPanelItem)
{
ToolStripPanelItem panel = p as ToolStripPanelItem;
foreach (ToolStripButton button in panel.Items)
{
listBox1.Items.Add(button.Text);
}

}
}

Please refer the below sample for your reference and let me know if this helps to you.
http://websamples.syncfusion.com/samples/Tools.Windows/F76127/main.htm

Please let me know if any concerns.

Regards,
Hema





JS John Slater August 26, 2008 11:52 PM UTC

Thanks Hema, This will work fine.

>Hi,

Thank you for your interest in Syncfusion Products.

You could try the following code to retrieve the ToolStripPanelItem's during runtime.

[C#]
foreach(ToolStripItem p in toolStripEx1.Items)
{
if (p is ToolStripPanelItem)
{
ToolStripPanelItem panel = p as ToolStripPanelItem;
foreach (ToolStripButton button in panel.Items)
{
listBox1.Items.Add(button.Text);
}

}
}

Please refer the below sample for your reference and let me know if this helps to you.
http://websamples.syncfusion.com/samples/Tools.Windows/F76127/main.htm

Please let me know if any concerns.

Regards,
Hema







AD Administrator Syncfusion Team August 27, 2008 04:33 AM UTC

Hi,

Thank you for the update.

Regards,
Hema


Loader.
Live Chat Icon For mobile
Up arrow icon