Hi,

I am currently trying to develop an application for a Symbol barcode scanner
running Windows Pocket PC 2002. The application has a login form , which
then moves to a menu form . The menu form then has buttons which load all
the other forms for the application. My problem is that when the user logins
in for example, I create a new instance of the menu form and call close on
the login form . If I then go check the running programs the login form is
still running? How do I close this form? Sorry I am very new to this! The
code I am executing on the login form is as follows :

Dim MenuForm As New frmMenu
MenuForm.ShowDialog()

Me.Close()

Any help would be greatly appreciated.


Regards
Brian

Re: Closing Forms by Tom

Tom
Mon Aug 22 15:52:35 CDT 2005

The code will not reach the Me.Close() line untill the MenuForm is closed.
The ShowDialog() will display the form and not return untill
MenuForm.DialogResult is set to a DialogResult value.

What I did was call my login form from the menu forms onload. On the Login
for I set DialogResult to either cancel or Ok depending on whether or not a
valid User/Password was entered. Below is my menu forms onload.

DialogResult dr;

frmLogon frml = new frmLogon();

frml.ShowDialog();


dr = frml.DialogResult ;


frml.Dispose();

if (dr.Equals(DialogResult.Cancel))

Application.Exit();




"Brian Blignaut" <brian@swanretail.com> wrote in message
news:e1L2SjypFHA.3936@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I am currently trying to develop an application for a Symbol barcode
> scanner running Windows Pocket PC 2002. The application has a login form ,
> which then moves to a menu form . The menu form then has buttons which
> load all the other forms for the application. My problem is that when the
> user logins in for example, I create a new instance of the menu form and
> call close on the login form . If I then go check the running programs the
> login form is still running? How do I close this form? Sorry I am very new
> to this! The code I am executing on the login form is as follows :
>
> Dim MenuForm As New frmMenu
> MenuForm.ShowDialog()
>
> Me.Close()
>
> Any help would be greatly appreciated.
>
>
> Regards
> Brian
>
>