Cannot get Picture Toolbox items to appear in VS 2005?

Report VG.net problems here.

Moderators: Frank Hileman, Anne Szyjan

Post Reply
User avatar
Frank Hileman
Site Admin
Posts: 1400
Joined: Sun Jul 25, 2004 8:16 pm
Location: California
Contact:

Cannot get Picture Toolbox items to appear in VS 2005?

Post by Frank Hileman » Fri Jun 09, 2006 10:05 am

If you add to the Toolbox in Visual Studio 2005 Picture-derived classes that are located in an external assembly, you should find that the Toolbox items can be used fine as sub-Pictures, but they do not appear, or are disabled, when using the Forms designer.

To fix this, add the following attribute above your Picture derived class (C# syntax):

Code: Select all

[ToolboxItemFilter(Picture.ToolboxFilter, ToolboxItemFilterType.Allow)]
VB syntax:

Code: Select all

<ToolboxItemFilter(Picture.ToolboxFilter, ToolboxItemFilterType.Allow)> _
After rebuilding, reset the toolbox, and add the assembly and Picture items again. This time they should be usable as top-level Pictures in a Canvas, as well as sub-Pictures in other Pictures.

You can also change the Toolbox bitmap for a Picture if you want to have a fancy icon.

eadred
Posts: 3
Joined: Tue Jul 18, 2006 1:08 am

Disabled toolbox items in VS 2003

Post by eadred » Tue Jul 18, 2006 1:10 am

I am getting the same problem with disabled toolbox items in Visual Studio 2003. How do I remedy it with .Net Framework 1.1, since the constructor parameters for the ToolboxItemFilter are different (it takes a string and a ToolboxItemFilterType)?
Eadred Birchenough

eadred
Posts: 3
Joined: Tue Jul 18, 2006 1:08 am

Whoops

Post by eadred » Tue Jul 18, 2006 1:13 am

Ignore me - I'm being stupid. Picture.ToolboxFilter is a string!!!
Eadred Birchenough

Post Reply