Hide/Unregister a component from designer toolBox

Stimulsoft Reports.NET discussion
Post Reply
Jean-Philippe Roques
Posts: 7
Joined: Tue Sep 25, 2007 3:09 am
Location: France

Hide/Unregister a component from designer toolBox

Post by Jean-Philippe Roques »

Hi,

I make an own derivated dataBand and register it. Now i have two dataBand in designer toolBox, mine and the original StiDataBand. I want to force user of designer to use mine derivated dataBand.

How can i hide the orginal StiDataBand from the toolBox ?

Thanks,
Jean-Philippe
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Hide/Unregister a component from designer toolBox

Post by Vital »

You can use following code:

Code: Select all

Stimulsoft.Base.Services.StiServiceContainer services = StiConfig.Services.GetServices(typeof(StiComponent));
			
foreach (StiComponent component in services)
{
	if (component is StiDataBand)component.ServiceEnabled = false;
}
Thank you.
Jean-Philippe Roques
Posts: 7
Joined: Tue Sep 25, 2007 3:09 am
Location: France

Hide/Unregister a component from designer toolBox

Post by Jean-Philippe Roques »

It works !

Thanks a lot Vital,

Jean-Philippe
Post Reply