My form1 has a checkedlistbox that is being populated by datatable, then there's a button to open form2 that will add records in checkboxlist. Now when the form2 closes, checkedlistbox from form1 will refresh. How to do this?
AngelicOne
4
Posting Whiz
Recommended Answers
Jump to PostYou can attach an event handler to the second form's Closed event when you open it and call code when it fires:
public partial class Parent : Form { public Parent() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Child child = new Child(); //create …
Jump to PostI'm sorry, i dont understand. What duplicates the first form?
Jump to PostSorry, your original post didn't mention that you were showing the form modally (which is what happens when you call ShowDialog), the code above was an example of how you can execute code in Form1 when Form2 is closed. this.Refresh() was an example, it just causes the form to repaint, …
All 11 Replies
Geekitygeek
480
Nearly a Posting Virtuoso
AngelicOne
4
Posting Whiz
Geekitygeek
480
Nearly a Posting Virtuoso
AngelicOne
4
Posting Whiz
Geekitygeek
480
Nearly a Posting Virtuoso
AngelicOne
4
Posting Whiz
Geekitygeek
480
Nearly a Posting Virtuoso
AngelicOne
4
Posting Whiz
Geekitygeek
480
Nearly a Posting Virtuoso
AngelicOne
4
Posting Whiz
AngelicOne
4
Posting Whiz
Geekitygeek
commented:
you got it :)
+2
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.