all groups > dotnet windows forms > september 2003 >
You're in the

dotnet windows forms

group:

Login dialog


Login dialog Alejandro Casal
9/23/2003 7:07:04 PM
dotnet windows forms:
Hi there,

I'm writing a .net Windows application in C#. I have 2 forms: the MainForm
and the Login. The MainForm opens the Login as Dialog from the MainForm's
constructor, and Login asks for username/password. I get these data from the
MainForm and check using a Web service that they're ok. If username/password
are not ok, I want to close the whole application, but I don't know how
(this.Close() doesn't work). Can I close the app from the MainForm's
constructor? Should I call the Login dialog and web service somewhere else?

Thanks,

Alejandro.

Re: Login dialog Herfried K. Wagner [MVP]
9/24/2003 12:33:07 AM
Hello,

"Alejandro Casal" <Alejandro@kpnmms.com> schrieb:
[quoted text, click to view]

The only way preventing the class from being instantiated is to throw an
exception.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

RE: Login dialog v-yiy NO[at]SPAM online.microsoft.com
9/24/2003 1:49:45 AM
Hi Alejandro,
You may try implement it this way.
1. In Constructor of your MainForm , set the MainForm.Visible = false;
2. In MainForm.On_Load() event handler, show the Login Dialog
and you can call Close() in this handler.
3. if login ok , then set the MainForm.Visible = true;
If you have problem with this, please let me know.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" shouldbe removed before
sending, Thanks!

--------------------
| From: "Alejandro Casal" <Alejandro@kpnmms.com>
| Subject: Login dialog
| Date: Tue, 23 Sep 2003 19:07:04 +0200
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Message-ID: <#55CdUfgDHA.632@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| NNTP-Posting-Host: ip503d4c11.speed.planet.nl 80.61.76.17
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:52946
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Hi there,
|
| I'm writing a .net Windows application in C#. I have 2 forms: the MainForm
| and the Login. The MainForm opens the Login as Dialog from the MainForm's
| constructor, and Login asks for username/password. I get these data from
the
| MainForm and check using a Web service that they're ok. If
username/password
| are not ok, I want to close the whole application, but I don't know how
| (this.Close() doesn't work). Can I close the app from the MainForm's
| constructor? Should I call the Login dialog and web service somewhere
else?
|
| Thanks,
|
| Alejandro.
|
|
|
Re: Login dialog Alejandro Casal
9/24/2003 1:09:54 PM

He Ying-Shen, it works, thanks a lot!

Alejandro.


[quoted text, click to view]

Re: Login dialog Alejandro Casal
9/26/2003 12:09:38 PM

He Ying-Shen, it works, thanks a lot!

Alejandro.


[quoted text, click to view]

AddThis Social Bookmark Button