Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Noob question about form changing...

Status
Not open for further replies.

NetNomad312

Technical User
Jun 16, 2004
27
US
Hey... I have a noob question, sorry (I bet you guys answer way too many of these). I have a simple little program... all it really does is act as a launcher for certain programs that would be harder to use otherwise (most of them being little DOS tools and such). Anyway, to set up the paths where my program would find these tools, I had to create setup screens (thus, multiple forms). Problem is, if I were to change to another window (another program, I mean, like going into explorer or browsing the internet), then come back to my program, it puts the main form on top. This wouldn't be a problem except I disable the main form when it loads the setup form, and it only gets re-enabled in the setup form's Form_Unload. Every time this happens I have to forcibly end the program with ctrl-alt-delete. How do other programmers avoid this?
 
How do you disable the main form?

Could you paste some code?

Transcend
[gorgeous]
 
Oh... I thought it was obvious, sorry. The only way I could think of to do it (other code removed, names changed for simplicity):

On main form:
Code:
cmdSetup_Click()
    frmMain.Enabled = False
    frmSetup.Show
End Sub

On setup form:
Code:
Form_Unload
    frmMain.Enabled = True
End Sub
 
HaVe you tried opening the setup form modally? Meaning that you must finish dealing with the setup form before you can deal with the main form again.
Code:
cmdSetup_Click()
    frmSetup.Show vbModal
End Sub


zemp
 
vbModal? Heh... another of the million little tiny things I never knew about VB. I forgot to mention that I'm working off two-year-old highschool course knowledge (they didn't teach us functions or anything and only once mentioned form changing). Thanks. One more thing: If I were to make the setup screen based on a tab strip, how do I go about editing the other tabs? When I created it originally it had a tab strip in it, but I couldn't edit the other three tabs... so I eventually deleted it. What am I missing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top