Can't get program to keep running main loop

I am making a windows form application and in the main loop of the source file I have:

int main() {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
UserInterface form;
Application::Run(%form);

//this just changes the text on one of the buttons in the windows form
form.button->Text = L"Test";
}


and after line 5 where is says Application::Run(%form) it wont run anything after that. The line where I tell it to change the text on the button wont work, and it doesnt get executed. Why is this? Is it because the computer focuses on the form header file and not the main loop? Please help!
Application::Run will end when you close the form. You can set the text of your button either in the constructor of the form or in the load event or at design time in the property inspector.
But I want to be able to edit the text in the main loop so that I dont have to edit that class.
You can't access the button outside the class because it is private in the form.

Why don't you want to edit the form?
Topic archived. No new replies allowed.