Link to home
Start Free TrialLog in
Avatar of GaneshDevx
GaneshDevx

asked on

how could i access a form created using instance by code?

I have created an mdiform containing a new menu.in this i create an instance of another form which contains a text box.every time i click i get a new instance of the form. i save the text in the text box using Activeform property in a random file.say i have 4 instances of the same form if i quit the app i rise a question to save the text in a file.i could only save the active form's text for no of times the instance of the form is created.how could i access the remaining 3 forms and save it?
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ryan Chong
Hi,

When quit the program:

Do while <ActiveForm is not nothing>
   <Save value to your file>
   <Close the current form>
loop
Avatar of HelixDaKat
HelixDaKat

In the form tht has the textbox add a Property that indicates that the contents of the box have changed.

In the unload event of the form add code to prompt the user to save the modified information.

This way you will always get a prompt when ever the user changes anything on anyform.

So if the user changes the values of windows 1,2, & 4. The user will be prompt 3 times to save the information.

HDK
Hi GaneshDevx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept TimCottee's comment(s) as an answer.

GaneshDevx, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Comment from expert accepted as answer

Computer101
E-E Moderator