I need to write two forms, frmMain and frmLogin.
I would like to show frmMain after i pres a button in frmLogin.

any ideas ?
tnx

Re: Log in by Morten

Morten
Wed Sep 20 03:31:01 CDT 2006

Hi Max3vil,

In your Main method you can call frmLogin.ShowDialog and if credentials
are ok, then start frmMain using Application.Run


On Wed, 20 Sep 2006 09:14:52 +0200, Max3vil <no@no.it> wrote:

> I need to write two forms, frmMain and frmLogin.
> I would like to show frmMain after i pres a button in frmLogin.
>
> any ideas ?
> tnx
>
>



--
Happy Coding!
Morten Wennevik [C# MVP]

Re: Log in by Max3vil

Max3vil
Wed Sep 20 06:18:02 CDT 2006

can you giveme an example ?

"Morten Wennevik" <MortenWennevik@hotmail.com> ha scritto nel messaggio
news:op.tf54lzztklbvpo@tr024.bouvet.no...
> Hi Max3vil,
>
> In your Main method you can call frmLogin.ShowDialog and if credentials
> are ok, then start frmMain using Application.Run
>
>
> On Wed, 20 Sep 2006 09:14:52 +0200, Max3vil <no@no.it> wrote:
>
>> I need to write two forms, frmMain and frmLogin.
>> I would like to show frmMain after i pres a button in frmLogin.
>>
>> any ideas ?
>> tnx
>>
>>
>
>
>
> --
> Happy Coding!
> Morten Wennevik [C# MVP]



Re: Log in by NathanJ

NathanJ
Wed Sep 20 15:26:27 CDT 2006

C# or VB?


Re: Log in by Max3vil

Max3vil
Thu Sep 21 01:04:43 CDT 2006

C# please ...

"NathanJ" <NathanielAJohnson@gmail.com> ha scritto nel messaggio
news:1158783987.036975.51130@e3g2000cwe.googlegroups.com...
> C# or VB?
>



Re: Log in by Morten

Morten
Thu Sep 21 01:51:34 CDT 2006

static void Main()
{
Form1 f =3D new Form1();

if(f.ShowDialog() =3D=3D DialogResult.OK)
Application.Run(new Form2(f.UserName));
}


Inside Form1 you set this.DialogResult =3D DialogResult.OK if the user i=
s =

valid (and then call this.Close(). Main then checks if Form1 was closed=
=

with a DialogResult.OK, and if so launches Form2

The UserName part is optional, and only shows that you can pass =

information from Form1 to Form2.



On Thu, 21 Sep 2006 08:04:43 +0200, Max3vil <no@no.it> wrote:

> C# please ...
>
> "NathanJ" <NathanielAJohnson@gmail.com> ha scritto nel messaggio
> news:1158783987.036975.51130@e3g2000cwe.googlegroups.com...
>> C# or VB?
>>
>
>



-- =

Happy Coding!
Morten Wennevik [C# MVP]