AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Iringtones11/14/2022 This can be done using the Visual Studio properties pane. You will need to make the Form2 textbox modifier Public. What are you trying to do? This would be a simple solution if you would create Form2 from within Form1, then open Form2, hide Form1 while Form2 is open, and then show Form1 again when Form2 is closed. Once Application.Run() is called, your application doesn't go any further within that Main method until the form is closed. Ok, I'm not sure I understand what you are trying to do, unless you are launching each form within a new thread, you won't have more than one form displayed at a time if you are using Application.Run() from within the static Main method. Even though we canceled the Form2 close, it should still be destroyed once the Click method is finished. Get the Form2 textbox value and place it within out Form1 textbox While Form2 is visible, keep Form1 hidden. Private void button1_Click(object sender, EventArgs e) } Next we have Form1's code, which instances Form2, shows it, waits in a loop with Form1 hidden until Form2 is no longer visible, re-displayes Form1, gets the textbox values it needs from Form2 and tada! Problem solved, if i understood the problem correctly. Private void Form2_FormClosing(object sender, FormClosingEventArgs e) We can't have the form unloading until Form1 has the textbox values. #Iringtones codeHere is the code for Form2 first, here all we are doing is canceling the form's close call. After re-reading your post, I think I understand that you are wanting to send Form1 strings to Form2 strings, and when Form2 closes, get those strings into Form1? That can be done fairly easily as well if that is the case.
0 Comments
Read More
Leave a Reply. |