Edit form control after Application::Run has been called on Form
I'm wondering, I am able to do functions such as Form1->textBox1->Text = "Hello" in the main cpp file before Application::Run and in the header file, but how do I edit the form controls after it has been called, ie while the form is showing without using the header file?
Re: Edit form control after Application::Run has been called on Form
[ moved thread ]
I don't really understand the problem.
You can just use the same method, so, Form1->textBox1->text = "Blabla" should still work.
Re: Edit form control after Application::Run has been called on Form
In the main C++ file that is generated with a new windows form application, i've created a thread that runs so that I can change a text box based on socket communication (irrelevant to my problem), when I try to do Form1->textBox1->Text = "Hello" I get this error.
Code:
1>.\Program.cpp(19) : error C2143: syntax error : missing ';' before '->'
1>.\Program.cpp(19) : error C2143: syntax error : missing ';' before '->'
And line 19 is (surprise, suprise)
Code:
Form1->inputbox->Text = "Hello!";
That's my problem, as you cannot do the functions I need to inside Form1.h without screwing around with the namespaces and includes which I do not want and hopefully do not need to do
Re: Edit form control after Application::Run has been called on Form
My guess is you forgot to close a bracket?
Anyway, when you have a syntax error like missing ";" don't look at the line it says... start going back until you find your error.
***
re: header
I put most of my Forms programming in the header. This feels strange to me still, but it makes sense once forms start including each other, methinks. I mean event handling and all that stuff is created by VStudio in the form's header file, so must be right.