|
-
Jul 29th, 2004, 09:03 AM
#1
Is this a bug, or am i doing something wrong
In a module I have a sub main which is the start of my app
In this module I have declared an instance of my main form
Public MainForm as new frmMain
and in sub main I call it
MainForm.ShowDialog
I show it as dialog because if I just use Show, then it goes right through sub main and exits the application...
now while i think that in itself is odd, i used showdialog so the app will run while the main form is open. This works fine, but when the user clicks the X button, I set e.cancel = true because its just supposed to minimize to the system tray... but for some reason, even if I set cancel to true, the app then resumes in submain and exits the program....
any ideas?
-
Jul 29th, 2004, 09:05 AM
#2
Hyperactive Member
Here's my Sub Main. Note that I run the app not show the form.
VB Code:
Public Sub Main()
Dim frm As New frmMain
Application.Run(frm)
End Sub
-
Jul 29th, 2004, 09:13 AM
#3
I was thinking the same thing but that still exits the app when using event.Cancel = true in the OnClosing Event
-
Jul 29th, 2004, 09:15 AM
#4
no it seems to work fine actually... setting cancel to true still works when using application.run
thanks!
-
Jul 29th, 2004, 09:16 AM
#5
Hmm. Wonder why it isnt working here.
Blah
-
Jul 29th, 2004, 09:17 AM
#6
Hyperactive Member
I just tried adding e.Cancel = True to the OnClosing event and it works for me as expected. It cancels the close event, the form stays open and the app continues to run just fine.
-
Jul 29th, 2004, 09:18 AM
#7
Im an idiot. I forgot to add handles mybase.closing...
D'uh
-
Jul 29th, 2004, 09:47 AM
#8
-
Jul 29th, 2004, 09:51 AM
#9
Not when you typed it out by hand. I do alot of thing manually because I am anal.
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
|