asked on
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
ASKER
private: System::Windows::Forms::TextBox^ textBox2;
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
this->textBox2 = (gcnew System::Windows::Forms::TextBox());
this->textBox2->Location = System::Drawing::Point(67, 94);
this->textBox2->Name = L"textBox2";
this->textBox2->Size = System::Drawing::Size(100, 20);
this->textBox2->TabIndex = 1;
//this->textBox1->Parent->Controls->Add(this->textBox2);
}
instead ofpublic:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
this->textBox1->Parent->Controls->Add(this->textBox2);
, run the code and a second text box appearsASKER
Microsoft Visual C++ (often abbreviated as MSVC or VC++) is an integrated development environment (IDE) product from Microsoft for the C, C++, and C++/CLI programming languages. It features tools for developing and debugging C++ code, especially code written for the Microsoft Windows API, the DirectX API, and the Microsoft .NET Framework. Many applications require redistributable Visual C++ packages to function correctly and are often installed independently of applications, allowing multiple applications to make use of the package while only having to install it once
TRUSTED BY
I'm not experienced doing such things in .NET - but I guess the problem is that the 'UtipsHel's control isn't created as control. I think you have to call 'CreateControl' against it, but I'm not really sure where this needs to be called - I would try it directly after the instantiation, i.e.:
Open in new window
Hope that helps,ZOPPO