I HAVE A PRINT BUTTON IN MAIN FORM.
THERE ARE many child forms.when we click the print on the main form, it has to print the details in the form that was open previously (because,when we click the print button,the main form gets focus.So,the form to be printed is actually the form that previously had focus).Please tell me how to store the detail of which form has focus .(remembering the last two focused form may do the trick..i dont know how to do it.)please help.


thank you

You could store a local variable in the parent Form, and implementing the GotFocus event in each of the children. Then update the variable in the parent Form by casting the Owner property.

is there any method to block the focus on the current open form,and then click on a button on the main form without passing the focus to main form .???

please forgive if i am acting silly... :)

sorry i dont know how to use the gotfocus thing exactly..can u write a few lines of code and show?i will be really grateful

i declared a variable in mainform .i can update its value in child forms.but the updated value is not appearing in main form.what to do?

i declared a variable in project settings,and kept changing its values in form activate event of each form..then when i click the button on the main form,i check the value of the variable..was simple :) thanks for ur suggestion..

This question has already been answered. Start a new discussion instead.