|
-
Jan 4th, 2004, 12:33 AM
#1
App.PrevInstance [resolved]
OK, I have 2 forms, the main one I want it to show only once, and the other as many times as you run the program, but it always showing either one or the other (in the same instance).
The problem with the next code is that when I run the program with a command i.e. the frmRestore is showing, the next time I run the program without the command, the main form does not show up, and I want it to because there is no previous instance of the main form.
If I do it the other way around, then it works. If I close all instances of my program, run it without a command, then run it with a command, then it works.... get it ?
VB Code:
Private Sub Form_Load()
If Command <> "" Then
Load frmRestore
Unload Me
Exit Sub
End If
If App.PrevInstance Then End
End Sub
Reading what I wrote, it still seems a bit confuzing. I'll try another way...
So... I have 2 forms, main form and frmRestore, when I run the program more than once, I want the main form to show only once, but the frmRestore more than once, and it should not matter in witch order I run them, main form should always be once...
Last edited by CVMichael; Jan 4th, 2004 at 02:21 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|