Inheriting UserControl

  • Thread starter Thread starter Allan Bredahl
  • Start date Start date
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
 
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
 
* "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?
 
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?
 
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
 
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
 
Back
Top