Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disabling ToolBoxItem in Vs ToolBox after some scanrio

1 view
Skip to first unread message

sarahh

unread,
Jan 17, 2012, 3:09:52 AM1/17/12
to
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.

bradbury9

unread,
Jan 17, 2012, 9:25:30 AM1/17/12
to
Never did that stuff, but i would check the ToolBoxItem properties and
methods. There is an interesting one called Lock()

http://msdn.microsoft.com/es-es/library/system.drawing.design.toolboxitem.lock.aspx

bradbury9

unread,
Jan 17, 2012, 9:30:32 AM1/17/12
to
On 17 ene, 09:09, sarahh <cohen...@gmail.com> wrote:
Answered a few min ago, dont see the response. kinda weird...

would take a look at the ToolBoxItem properties and methods. There
are a couple of interesting ones:
http://msdn.microsoft.com/es-es/library/system.drawing.design.toolboxitem.lock.aspx
and
http://msdn.microsoft.com/es-es/library/system.drawing.design.toolboxitem.filter.aspx

hope it helps. Never made myself a designer.
0 new messages