Adding Reference to User Control

  • Thread starter Thread starter C# Learner
  • Start date Start date
C

C# Learner

I added a custom control to my project (Project -> Add User Control) and it
won't show up under 'My User Controls' in the Toolbox.

How do I get it to show up?

(I know I could get it to show by right-clicking over the Toolbox, choosing
'Add/Remove Items...', and then browsing for my project's executable - but
if I added the "debug" executable, say, I fear I'd have to redo this every
time I build a "release" executable.)
 
As long as a control inherits from the UserControl class it should showup in
the toolbox.
I guess you don't add your own designer, do you?

It is possible that the toolbox may not catch up instantly, but the user
control has to show up as soon as you open a form or other control in the
designer.

Keep in mind that the user control is not available in the toolbox (dimmed
usually) if the active control in the designer is the usercontrol itself. In
other words you can't add the control to itself.
 
Hi there:

VS .NET 2003 Requieres that you show up your control first in the designer,
(by double-clicking the control file) in order for it to realize it is a
control so it appears on the "My User Controls" Toolbox.

I hope VS.NET 2005 fix this behaviour.

Nando
 
Back
Top