strange problem with inherited controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a strange problem with inherited controls:

I have created two user controls called UserLoginA & UserLoginB.
One of the properties of these controls is of type UserGroup ( a class I
defined in another assembly).
Then I show that UserLoginA & UserLoginB have a lot of common code,
so I decided to inherit UserLoginB from UserLoginA.
So I Created a new user control UserControlC that inherits from UserLoginA,
added the code needed to make it work like UserLoginB, tested it, and
everything worked just fine.
Then I removed the file that defined UserLoginB from the project, and
renamed UserLoginC to UserLoginB (so I will not have to change all the code
using UserLoginB).
Then the strange stuff started:
Now when I try to drag UserControlB (that used to be UserControlC) on a from
I get this error:

Then I create an inherited user control called UserLogin2 that inherits from
UserLogin.
When I add these controls to the toolbox and try to drap UserLogin2 to the
form
I get an error:
An exception occured while trying to create an instance of UserLoginB. The
exception was "The type serialized in the .resources file was not the same
type that the .resources file said it contained. Expected "UserGroup" but
read ""UserGroup".".

Does anybody have any Idea why this happens?

Thanks,
Nadav.
 
Back
Top