Disabling ToolBoxItem in Vs ToolBox after some scanrio

S

sarahh

Hi,
I make a designer with Visual Studio 2010 and use also the Vs
ToolBox(adding custom controls) by the following:

IToolboxService toolBoxService =
(IToolboxService)Package.GetGlobalService(typeof(IToolboxService));
toolBoxService .AddToolboxItem(toolboxitem, category);
toolBoxService .Refresh();

After dropping specific toolboxitem control on the designer I need
that this item will be disabled (grayed out).

I have the following questions:
1. How could I disable toolboxitem, whereas other toolboxitem in it's
category remain enabled?
2. How I disable the dropping of this toolboxitem?

Thanks.
 
B

bradbury9

Hi,
I make a designer with Visual Studio 2010 and use also the Vs
ToolBox(adding custom controls) by the following:

IToolboxService toolBoxService =
(IToolboxService)Package.GetGlobalService(typeof(IToolboxService));
toolBoxService .AddToolboxItem(toolboxitem, category);
toolBoxService .Refresh();

After dropping specific toolboxitem control on the designer I need
that this item will be disabled (grayed out).

I have the following questions:
1. How could I disable toolboxitem, whereas other toolboxitem in it's
category remain enabled?
2. How I disable the dropping of this toolboxitem?

Thanks.

Maybe you sould consider asking in the Visual Studio group, doesnt
seem a c# specific question. Check the
microsoft.public.vstudio.general

hope it helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top