Form.Showdialog question

J

Jm

Hi all

Im not sure of the best way to be displaying my forms and just want a bit of
clarification. Being only recently moved to vb.net im still used to the old
vb6 form.show method, now under vb.net that doesnt seem to do alot most of
the time so far as i can tell. So im using form.showdialog all the time. But
it seems as though once i call this code, all control transfers to the open
form and only when closed the control returns to the original code and it
the proceeds. Im hoping im right so far and this doesnt sound really stupid
and wrong. So what im wondering is, is there a way to open a form and let it
run its code but to move on while the form is still open with the original
code ? Or is this not possilbe. Any help is greatly appreciated

Thanks
 
K

Ken Tucker [MVP]

Hi,

ShowDialog displays the form and waits until it is closed.
Show displays the form.

Not sure what you mean form.show doesnt seem to do alot most of
the time so far as i can tell.

Ken
-------------------------------------
Hi all

Im not sure of the best way to be displaying my forms and just want a bit of
clarification. Being only recently moved to vb.net im still used to the old
vb6 form.show method, now under vb.net that doesnt seem to do alot most of
the time so far as i can tell. So im using form.showdialog all the time. But
it seems as though once i call this code, all control transfers to the open
form and only when closed the control returns to the original code and it
the proceeds. Im hoping im right so far and this doesnt sound really stupid
and wrong. So what im wondering is, is there a way to open a form and let it
run its code but to move on while the form is still open with the original
code ? Or is this not possilbe. Any help is greatly appreciated

Thanks
 
C

Carlos J. Quintero [.NET MVP]

Hi,

In VB6 you had:

frm.Show, frm.Show 0 or frm.Show vbModeless: this opens the form in a
modeless way.
frm.Show 1 or frm.Show vbModal: this opens the form in a modal way.

In VB.NET you have:

frm.Show: this opens the form in a modeless way.
frm.ShowDialog: this opens the form in a modal way.

So, if you were using frm.Show, you should use it instead of frm.ShowDialog
since you don´t want modal dialogs.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code and design much faster.
http://www.mztools.com
 
J

Jm

Hi Ken

Sorry, should have clarified that a bit further, meant to say when running
from inside a service program. Is there any special way to be using the
forms, im basically saying:

Dim myForm As New Form1
myForm.ShowDialog()

and if i were to use Show i just replace the ShowDialog() ?
 
H

Herfried K. Wagner [MVP]

Jm said:
Sorry, should have clarified that a bit further, meant to say when running
from inside a service program. Is there any special way to be using the
forms, im basically saying:

Dim myForm As New Form1
myForm.ShowDialog()
\\\
myForm.Dispose()
///

and if i were to use Show i just replace the ShowDialog() ?

Yes... But showing forms from within a service program is not recommended.
Instead, write a client/controller application that communicates with the
service over sockets, remoting or events and displays the GUI.
 

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