Inherited UserControls do not in appear in Toolbox (VB.NET 2005)

B

b747_440

Dear Newsgroup,
I'm an old VB6.0 developper who switched some time ago to VB.NET 2005.
I really like that new Visual Studio. However, something is going wrong
now and I can't figure out, what it is...
I was playing around with UserControls which are inherited from
standard .NET controls to make myself some transparent controls.
Suddenly I realized that after bulding my project those UserControls do
not appear in the Toolbox anymore. I had before an error which caused
the designer to crash. I've searched MSDN, usenet and web. Uninstalled
..NET Framework 1.1, reinstalled VB.NET 2005 (Express). There seems to
be such a problem about .NET Studio 2003. However, I'm using 2005.
When I open an old project, my UserControls are still there and I can
add new ones. But it won't work in new projects.
Maybe I'm doing something terribly stupid, so I would like to describe
how I think UserControls should be generated. Am I overseeing
something?
1. Open new Windows Application project.
2. Add Class to Project.
3. E.g.:
Public Call1
Public Class ListBoxExtended
Inherits System.Windows.Forms.ListBox
Public Sub TestListBox
Msgbox "Test"
end sub
end class
end class
4. Compile/Build, no erros.
5. Going to Designer: just nothing, no "ListBoxExtended"

I'm really desperate in the meanwhile. Any hints and comments are
welcome.
Thanks a lot,
Bart
 
B

b747_440

Hello Newsgroup,
I have just found out that adding my EXE manually to the Toolbox solves
the problem. Can I switch it somehow on, that just after compiling the
UserControl appears automatically in the Toolbox?
What if I change the inherited UserControl? Do I have to recompile and
readd manually to update the controls on the form? Will I even have to
pull every control again on the form to get new functionality?
Thanks,
Bart (Desperate...)
 
G

Guest

I believe this is a bug in VB.Net 2003. I finally gave up on adding controls
to the toolbox and just add a reference then instantiate them and add them to
my forms in code. Maybe SP1 for VB.Net 2003 will resolve this bug.
 
G

Galen Somerville

Hello Newsgroup,
I have just found out that adding my EXE manually to the Toolbox solves
the problem. Can I switch it somehow on, that just after compiling the
UserControl appears automatically in the Toolbox?
What if I change the inherited UserControl? Do I have to recompile and
readd manually to update the controls on the form? Will I even have to
pull every control again on the form to get new functionality?
Thanks,
Bart (Desperate...)

I'm in the same VB6 boat that you are in. I have found that a UserControl
once compiled and placed in the toolbox, stays in the toolbox if you
"Rebuild". It's just the first time that you "Build"

GalenS
 

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