Answered by:
winforms c++ : how to change textbox or any other component in one form from other form

Question
-
I am in a very crucial point in my work project, and I must get some help.
i followed and researched every way online, but without any working result.
in general, I need to update components that are located in one form from another form - and I need to do it with several components (it can be a textbox, a webview2 component).
in MyForm.h:
this->txtBoxLogText->AcceptsReturn = true; this->txtBoxLogText->Location = System::Drawing::Point(288, 409); this->txtBoxLogText->Multiline = true; this->txtBoxLogText->Name = L"txtBoxLogText"; this->txtBoxLogText->Size = System::Drawing::Size(580, 300); this->txtBoxLogText->TabIndex = 37;
in cameraSetup.h (the other form):
Calc::cameraSetup::cameraSetup(){ InitializeComponent(); Calc::MyForm dsg; //MyForm f1;}
in the relevant component/event i decalired this:
System::Void Calc::cameraSetup::btnConnectVideoFeedLan_Click(System::Object^ sender, System::EventArgs^ e) { Calc::MyForm::txtBoxLogText df; this->dsg.webView21->CoreWebView2->Navigate(L"http://www.google.com"); this->dsg.webView21->Source = (gcnew System::Uri(L"http://www.google.com", System::UriKind::Absolute)); this->dsg.webView21->Refresh(); this->dsg.webView21->CoreWebView2->NavigateToString(L"http://www.google.com"); }
this doesn't have any affect.
other attempts:
in txtBoxLogText Ii have changed modifier to public. then i tryied accesing it from the CameraSetup.h form - but it is undifined.
I tried to follow and implement some c# very simple solutions, but again, nothing worked.
please, if you can show me a way to do so, it will help me continue the project.
I must say that I am a c developer and not c++. the only reason I'm using c++ is the GUI (next time I will make it in c#), so I have very basic knowledge in C++.
- Moved by Xingyu ZhaoMicrosoft contingent staff Monday, September 28, 2020 5:27 AM
Saturday, September 26, 2020 10:48 AM
Answers
-
Hello,
you could ask here:
https://docs.microsoft.com/en-us/answers/topics/windows-forms.html
Regards, Guido
- Proposed as answer by Dave PatrickMVP Monday, September 28, 2020 12:43 PM
- Marked as answer by Dave PatrickMVP Thursday, October 1, 2020 9:53 PM
Monday, September 28, 2020 5:42 AM -
Or also try asking for help over here.
https://docs.microsoft.com/en-us/answers/topics/c++.html
https://developercommunity.visualstudio.com/spaces/62/index.html
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Guido Franzke Monday, September 28, 2020 1:02 PM
- Marked as answer by Dave PatrickMVP Thursday, October 1, 2020 9:53 PM
Monday, September 28, 2020 12:44 PM
All replies
-
Hi David Frucht,
Thank you for posting here.
In order to help you find the correct forum to go ask questions, I have moved the thread to 'where is the forum for' forum.
Thank you for your understanding.
Best Regards,
Xingyu Zhao
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Monday, September 28, 2020 5:27 AM -
Hello,
you could ask here:
https://docs.microsoft.com/en-us/answers/topics/windows-forms.html
Regards, Guido
- Proposed as answer by Dave PatrickMVP Monday, September 28, 2020 12:43 PM
- Marked as answer by Dave PatrickMVP Thursday, October 1, 2020 9:53 PM
Monday, September 28, 2020 5:42 AM -
Or also try asking for help over here.
https://docs.microsoft.com/en-us/answers/topics/c++.html
https://developercommunity.visualstudio.com/spaces/62/index.html
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Guido Franzke Monday, September 28, 2020 1:02 PM
- Marked as answer by Dave PatrickMVP Thursday, October 1, 2020 9:53 PM
Monday, September 28, 2020 12:44 PM