how to check if form was activated
-
i have an MDI child (MDI1) form which I am opening another MDI child (MDI2) from that form. How can I check if MDI1 was ctivated after closing MDI to refresh it? do I have to use Enter or Activated events?
-
i have an MDI child (MDI1) form which I am opening another MDI child (MDI2) from that form. How can I check if MDI1 was ctivated after closing MDI to refresh it? do I have to use Enter or Activated events?
use
this.ActiveMdiChild
It will return the MDI child form that is currently active. If you want to activate another form just use frm2.focus(); :rose:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
use
this.ActiveMdiChild
It will return the MDI child form that is currently active. If you want to activate another form just use frm2.focus(); :rose:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
I don't want to focus it. well, let me explain it more.. MDI2 is an edit form of MDI1 so MDI is just viewing the data where MDI2 is the edit. when the user clicks on the edit button (on MDI1) it will open MDI2. when the user click save (on MDI2) it will close MDI2.. now I want to know if any data were changed and refresh the data on MDI accordainaly.
-
I don't want to focus it. well, let me explain it more.. MDI2 is an edit form of MDI1 so MDI is just viewing the data where MDI2 is the edit. when the user clicks on the edit button (on MDI1) it will open MDI2. when the user click save (on MDI2) it will close MDI2.. now I want to know if any data were changed and refresh the data on MDI accordainaly.
Well, Do the refresh of data when form is activated. Write the code inside
Form_Activated
to refresh the form with new data. Dont forget to set a flag when edit is done and recheck the flag withinform_Activated
. Otherwise the data will be refreshed every time you activate the form.:cool:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
I don't want to focus it. well, let me explain it more.. MDI2 is an edit form of MDI1 so MDI is just viewing the data where MDI2 is the edit. when the user clicks on the edit button (on MDI1) it will open MDI2. when the user click save (on MDI2) it will close MDI2.. now I want to know if any data were changed and refresh the data on MDI accordainaly.
Create a bool on MDI2, set it to true if data is edited. Create a readonly property for this bool on MDI2 and check it from MDI1. Refresh if true.
Regards Mick Curley :)
-
i have an MDI child (MDI1) form which I am opening another MDI child (MDI2) from that form. How can I check if MDI1 was ctivated after closing MDI to refresh it? do I have to use Enter or Activated events?