Inheriting UserControl

A

Allan Bredahl

Hi all

I have a very strange problem.


I have a UserControl called "Search" :


Public Class Search
Inherits System.Windows.Forms.UserControl
...
End Class


This Control contains absolutely nothing besides the autogenerated code from
Windows Form Designer.


Now I make an second class, and try to inherit this from Search :

Public Class SearchUsers
Inherits Search
...
End Class



Now when I try to view the designer of the SearchUsers control I get the
following error :


"An error occurred while loading the document. Fix the error and then try
loading the document again. The error message follows: ?"


I must say that this error message is lacking some information: Nothing but
a questionmark.



Does anyone know what is happening here?


Thanks in advance


Allan Bredahl
 
F

Fergus Cooney

Hi Allan,

One possibility ??

Are these UCs in separate projects? If so, did you build the Search
project before opening the Designer for SearchUsers?

Regards,
Fergus
 
H

Herfried K. Wagner [MVP]

* "Allan Bredahl said:
Public Class Search
Inherits System.Windows.Forms.UserControl
...
End Class


This Control contains absolutely nothing besides the autogenerated code from
Windows Form Designer.


Now I make an second class, and try to inherit this from Search :

Public Class SearchUsers
Inherits Search
...
End Class



Now when I try to view the designer of the SearchUsers control I get the
following error :


"An error occurred while loading the document. Fix the error and then try
loading the document again. The error message follows: ?"

Did you create 'SearchUsers' by hand?
 
A

Armin Zingler

Allan Bredahl said:
I have a UserControl called "Search" :


Public Class Search
Inherits System.Windows.Forms.UserControl
...
End Class


This Control contains absolutely nothing besides the autogenerated
code from Windows Form Designer.


Now I make an second class, and try to inherit this from Search :

Public Class SearchUsers
Inherits Search
...
End Class



Now when I try to view the designer of the SearchUsers control I get
the following error :


"An error occurred while loading the document. Fix the error and then
try loading the document again. The error message follows: ?"

Have you already compiled the "Search" control?
 
A

Allan Bredahl

Herfried K. Wagner said:
Did you create 'SearchUsers' by hand?

Yep

I simply used "Add User Control...", and changed the Inherits statement from
'Inherits UserControl' to Inherits Search'



/

Allan
 
A

Allan Bredahl

Have you already compiled the "Search" control?

I believe so, since the two controls is placed in the same project.



Maby I'm looking at some spooky project problems here?

Will try to make another project, and see if the problem continues.



/

Allan
 

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