Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User controls auto adding to VS toolbox

Status
Not open for further replies.

Dinobrago

Technical User
Dec 8, 2001
184
US
I occassionally write UserControls as part of a project in VS2003 (ie. not in a control library). Handily, the new UserControl automagically shows up in the toolbox in a section called "User Controls" from which I can use the new user control on a form. Very nice.

However, this only happens sporadically. Sometimes, I exit from VS and when I return, lo and behold, the new user control is there in the toolbox. Other times, it never happens. I can add that control manually to the toolbox without any problems and it works fine. It gets a little gear icon which is different from the icon if the IDE adds it automatically.

I have not been able to identify any rhyme or reason to when it does or does not automatically add the user control to the toolbox.

1) Has anyone else observed this behavior? and 2) is there any way to "refresh" or force the IDE to pick up new user controls from a project?

d-
 
I haven't seen this.

Are you running VS.NET 2003?

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Yes, Visual Studio 2003.

After a little more investigation, the appearance of the user controls under "My User Controls" does require that a separate dll appear for that user control.

If the user control is part of the project namespace, a separate dll is not created but I have not gone through the variations.

In this last pass, I created a separate ControlLibrary as part of my solution with a separate namespace. This did not show up automatically -- although the "My User Controls" panel did appear! As usual, I could add them manually and use them. Now, in this case, the user controls are all in a single dll - myUserControls.dll.

d-
 
I have talked with a few other people who have noticed this as well. Unfortunately, they see the same behavior.

I was incorrect in my previous note - it does not appear to require a separate DLL but is related to UserControls that are part of a project. They appear in UserControls as a Usercontrol icon (like a little keypad).

Go figure....
 
I believe you can change the icon by creating a .ico file with the same name as your usercontrol project and putting it in the bin directory(s).

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top