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. 1 1779
Delete the directory "obj" and compile the project again
"Nadav" <Na***@discussi ons.microsoft.c om> schrieb im Newsbeitrag
news:AF******** *************** ***********@mic rosoft.com... 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Terrance |
last post by:
Hello all I have a question I'm hoping someone can shed some light on. I have
2 user Inherited Controls on a form. When I click 1 inherited control I would
like to change the text of the other Inherited Control. Is there anyway to do
this? For example, I have an ADD button which is inherited and a EXIT button
which is inherited. The reason I made them inherited is because I want to use
the function of these buttons in other forms and don't...
|
by: 42 |
last post by:
I implemented a simple class inherited from Page to create a page
template. It simply wraps some trivial html around the inherited page,
and puts the inherited page into a form.
The problem I have run into is that the emitted html at the end of the
process is slightly different and doesn't work.
Please don't be put off by all the source code. All the guts are in this
first base class, and it doesn't do much. The rest is trivial...
|
by: Spam Trap |
last post by:
I am getting strange resizing problems when using an inherited form.
Controls are moving themselves seemingly randomly, but reproducibly.
"frmBase" is my base class (a windows form), and contains a few controls
anchored to the sides of the form.
"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I place
addition controls on the "frmChild" form. When I...
|
by: Paul W |
last post by:
Hello everyone,
My problem is with an inherited Form. The base Form has a few controls on
it that are anchored such that they move as the Form is resized. While in
the designer, the inherited Form works perfectly but when I run the program
the controls on the inherited Form are positioned based on the size of the
base Form instead of the inherited Form. The controls move approriately as
the Form is resized but they are never in the...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |