المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Reload Form1 when Form2 ShowDialog like?



C# Programming
03-11-2012, 09:22 AM
Hi all!

I asked for the issue as follows:

I can program in C
Windows Form. I have two Form: Form1 and Form2.
Form1 has a datagrid and a button1. In the DataGrid displays the user with 2 column username and password.
Form2 has two TextBox is txtTenDangNhap and txtMatKhau, and a Button btnLuu.

In Form1:

When Form1 loads the program will load a list of accounts available in the database to the DataGrid.
When you click Button1, then Form2 will appear in the form of ShowDialog. (Form2 f2 = new Form2 (); f2. ShowDialog ()) (Note: Form1 is still not closed)

On Form2: When pressing Button btnLuu, the new account will be saved to the database and Form2 will close.
When Form2 is closed on Form1 DataGrid will load the data with the new account added.

For help yourself with!