Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

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;
__gc class XtraTextBox: public TextBox 
{/*...*/ 
 int HeleMat;
 int HalveMat;
 int Sikre;
 int HeleUt;
 int HalveUt;
};
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscowFlag of Switzerland imageFreelance programmer / Consultant

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

Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answers