troubleshooting Question

TextBox inheritance

Avatar of toyboy61
toyboy61 asked on
Visual C++.NET
9 Comments1 Solution362 ViewsLast Modified:
I have defined a new class called "XtraTextBox" which inherits all properties from the class TextBox (built-in class), and have added some extra variables.

Later on I create an instance of this new class and populates it with property-values from an existing TextBox called "Hele". This new instance is called "UtipsHel", and I want to copy property values from the existing TextBox called "Hele" to this new instance of XtraTextBox.

"UtipsHel" should after this be a copy of "Hele", and in the end I make "Hele" invisible and "UtipsHel" visible. My goal is the replace "Hele" with "UtipsHel" on the form (Form1). But "UtipsHel" never shows up.

What have I done wrong here ?

(Visual Studio 2003 .NET).








XtraTextBox* UtipsHel = new XtraTextBox();
			
UtipsHel->Location = Hele->Location;
UtipsHel->BackColor = Color::FromArgb(255,255,0,0); // pure red
UtipsHel->ForeColor = Color::FromArgb(255,0,0,255); // pure blue 
UtipsHel->Enabled = Hele->Enabled;
UtipsHel->Font = Hele->Font;
UtipsHel->Size = Hele->Size;
UtipsHel->Text = Hele->Text;
UtipsHel->Text = S"RUBBISH";
Hele->Visible=false;
UtipsHel->Visible=true;

Open in new window

__gc class XtraTextBox: public TextBox 
{/*...*/ 
 int HeleMat;
 int HalveMat;
 int Sikre;
 int HeleUt;
 int HalveUt;
};

Open in new window

ASKER CERTIFIED SOLUTION
AndyAinscow
Freelance programmer / Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros