By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,890 Members | 1,236 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,890 IT Pros & Developers. It's quick & easy.

Display modeless form from Sub Main

P: n/a
My project starts with Sub Main and then needs to display
a modeless form.
From some reason the application closes it self after
calling the Show method.
How can I avoid the application from being closed.
By the way in VB6 there is no problem to do it.
This is the code I have:

Option Explicit On

Module Module1

Public f1 As New Form1()

Sub main()
f1.Show()
End Sub
End Module

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Rami,

Sub main()
f1.Show()
Application.Run
End Sub

Application.Run will start the message pump going so that windows in the
thread (ie f1) have a working message queue.

Regards,
Fergus
Nov 20 '05 #2

P: n/a
Hello,
"Rami" <ra*****@hotmail.com> schrieb:
My project starts with Sub Main and then needs to display
a modeless form.
From some reason the application closes it self after
calling the Show method.
How can I avoid the application from being closed.
By the way in VB6 there is no problem to do it.
This is the code I have:

Option Explicit On

Module Module1

Public f1 As New Form1()

Sub main()
f1.Show()
End Sub
End Module


\\\
Application.Run(New Form1())
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.