Take the 2-minute tour ×

Somebody have an idea how to rename form onLoad? I tried:

private: System::Void General_Load(System::Object^  sender, System::EventArgs^  e) {
         String^ test = "test";
         String^ x= "General: " + test;
         this->Name = x;

but it doesn't work.

share|improve this question
How doesn't it work? What happens? –  Goz Jul 21 '12 at 16:02
Nothing happens. –  user1100671 Jul 21 '12 at 16:04
What? The name doesn't change? How do you know that "nothing happens"? –  Goz Jul 21 '12 at 16:04
The name doesn't change –  user1100671 Jul 21 '12 at 16:05
Use the debugger, set a breakpoint. If it doesn't fire then you wrote an event handler but forgot to subscribe it. A form should not listen to its own events, override the OnLoad method instead. –  Hans Passant Jul 21 '12 at 16:42

1 Answer 1

I should use this->Text = x; not this->Name = x;

share|improve this answer
I really think he IS trying to change the name rather than the Text. –  Goz Jul 22 '12 at 6:15

Your Answer


