bungpeng Posted November 13, 2003 Posted November 13, 2003 In SDI environment, how do I unload other form? For example: form A open form B, now form B want to unload form A. TQ Quote
Administrators PlausiblyDamp Posted November 13, 2003 Administrators Posted November 13, 2003 You will need to pass a reference to Form A to form B. Search these forums and you'll find a good few samples on this. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
bungpeng Posted November 13, 2003 Author Posted November 13, 2003 I did search in this forum before post this question... Pass reference to Form A to Form B... I think I understand that, it means if I never pass, then there is no way to unload the form A? Quote
Leaders snarfblam Posted November 19, 2003 Leaders Posted November 19, 2003 give formB a property or function (or constructor parameter) that allows formA to send its reference to formB, ie: Private Dim FormToClose as Form . . . Public Sub SetFormToClose(FormA as form) FormToClose = FormA End Sub[/Code] so that anytime formb can just call [code]FormToClose.Close After FormA creates FormB, FormA should make the call FormB.SetFormToClose(Me)[/Code] to provide formB with a reference to itself Quote [sIGPIC]e[/sIGPIC]
bungpeng Posted November 19, 2003 Author Posted November 19, 2003 Thank you very much! I understand what you mean. Quote
*Experts* mutant Posted November 19, 2003 *Experts* Posted November 19, 2003 Remeber that if you close the the form on which the application loop depends then the whole application closes. So if you start with FormA it might be a better idea to hide it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.