Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

Application fail to terminate between multiple forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pedestrian - 22 Aug 2006 08:53 GMT
I create 2 forms for a windows form application:  (coding attached)
1) FrmLogin : the login form which show when the application start
2) FrmMain : the main form which show if user input "User" in a textbox in
login form, else
             it won't show.

Problem: If I input "user" in login form to go to the main form, main form is
shown, but
when I close the main form (FrmMain), the application doesn't terminate...

How to manage application termination for multiple forms project which show
only 1 form
at a time? Thanks for replying...

Public Class FrmLogin

   Private Sub btnOK_Click(...)...
       If txtUser.Text = "User" Then
           Me.Hide()
           FrmMain.Show()
       Else
           Me.Close()
       End If
   End Sub

End Class

Signature

Pedestrian, Penang.

FUnky - 22 Aug 2006 11:46 GMT
The application does not terminate because the login form is still running
.. you've just hidden it.

One way to do this would be to raise an event from the main form when the
close button is clicked, handle it in the login form where you could call
Me.Close().
pedestrian - 23 Aug 2006 02:37 GMT
I shall try it... Thanks FUnky...

>The application does not terminate because the login form is still running
>.. you've just hidden it.
>
>One way to do this would be to raise an event from the main form when the
>close button is clicked, handle it in the login form where you could call
>Me.Close().

Signature

Pedestrian, Penang.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.