• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

VB 6 question about forms

Codewiz

Diamond Member
have written a program that utilizes two forms. I only show one form at a time and allow for the user to switch back and forth between them using control buttons. How can I setup my main form so that the "X" button at the top right unloads both forms?

How can I setup the "X" button on the summary form to unload the summary form but make the Main form visible.

I want the main "X" to completely exit the program while the summary "X" to close that form and make the main form visible.

Sorry about the easy question but I can't find the answer.
 
in the Form QueryUnload event, put the appropriate code. There is a parameter called UnlaodMode that tells you if the form is closing because the X was clicked(1) or through code(0). In the summary form, if this parameter is 0 do nothing. If it is 1 then do frmMain.Show.

In the main form, you can do Unload frmSummary in the QueryUnload event.
 
You could also set up both forms as subforms in one main form. That way when you close the main form both subforms go.
 
Back
Top