Closing the form run by Application.Run

T

Tim

Is it possible to close the form I invoked via
Application.Run() as I invoke another form without
the application exiting? (I'd rather not hide it
since I don't need it anymore)

....call to form:

Application.Run(new form1)


......from a button on form1:

dim f as new form2

form2.show
me.close


Thanks.
 
A

Armin Zingler

Tim said:
Is it possible to close the form I invoked via
Application.Run() as I invoke another form without
the application exiting? (I'd rather not hide it
since I don't need it anymore)

...call to form:

Application.Run(new form1)


.....from a button on form1:

dim f as new form2

form2.show
me.close


Thanks.

Sub Main:
f = new form1
f.show
application.run()

Call application.ExitThread to exit application.run.
 
H

Herfried K. Wagner [MVP]

Hello,

Tim Nelson said:
Application.Run( ) does not compile because it wants a
"frm" as a parameter.
Am I missing something here?

There is a parameterless overloaded version of 'Application.Run'. It works
perfectly on my .NET 1.0 machine. Which version of .NET do you use? Which
compilation error do you get?
 
T

Tim Nelson

Herfried,

C:\Documents and Settings\nelson\My Documents\Visual Studio
Projects\RFDDS\main.vb(32): Argument not specified for parameter 'fm' of
'Public Shared Sub Run(fm As System.Windows.Forms.Form)'.

I am using VS 2003 Pro using the .NET compact framework try to build
an application that runs on the Pocket PC.

Thanks.
 
A

Armin Zingler

Tim Nelson said:
Herfried,

C:\Documents and Settings\nelson\My Documents\Visual Studio
Projects\RFDDS\main.vb(32): Argument not specified for parameter 'fm'
of 'Public Shared Sub Run(fm As System.Windows.Forms.Form)'.

I am using VS 2003 Pro using the .NET compact framework try to
build an application that runs on the Pocket PC.


The docs for Application.Run say that only Application.Run(Form) is
supported.

BTW, there's also microsoft.public.dotnet.framework.compactframework
 
H

Herfried K. Wagner [MVP]

Hello,

Tim Nelson said:
C:\Documents and Settings\nelson\My Documents\Visual Studio
Projects\RFDDS\main.vb(32): Argument not specified for
parameter 'fm' of 'Public Shared Sub Run(fm As System.Windows.
Forms.Form)'.

I am using VS 2003 Pro using the .NET compact framework
try to build an application that runs on the Pocket PC.

It seems that the parameterless overload of 'Run' is not supported by the
Compact Framework.

Notice that you will have a better chance to get an answer if you post to
the .NET Compact Framework newsgroup in future:

news://msnews.microsoft.com/microsoft.public.dotnet.framework.compactframework

Web interface:

http://msdn.microsoft.com/newsgroup...soft.public.dotnet.framework.compactframework
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top