Main Form Closing After Login?

Apr 3, 2009

Ok i have a login window which connects to a MySQL database and authenticates the user. Works perfect, BUT

If rowsEffected > 0 Then
cnMySQL.Close()
LoginForm1.Close()
MainForm.Show()
Else
cnMySQL.Close()
MsgBox("Login Failed!")
End If

That's supposed to close the login form and open the main form if the query returned a positive match of the login information. The login works, closes the login form, opens the main form, than mysteriously exits the application. I'm guessing its something simple but i don't see it .. the main form has nothing in it besides some inputs and labels no subs at all and if i change the form which the program starts to to the main form it runs as designed.

I know usually if you start your program from a module and use Application.Run() you can keep the thread open, but this is all forms no background work so i didn't want to go that direction.P.S. i just removed LoginForm1.Close() and it logs me in fine and opens the main form fine and keeps the app running but the login form is still open.

View 5 Replies


ADVERTISEMENT

VS 2008 Closing All Forms When Program Closes Vs. Closing All But Main Form

Jun 4, 2010

Dim frm As Form
For Each frm In Forms
Set frm = Nothing
Next frm

The above code is what I used in VB6 to close all forms associated with my programs before my program closed. I have been searching for information on how to make sure all forms are closed when closing a VB2008 program.

I have seen info on using the Project Property Shutdown mode When startup form closes and I currently have this set.

Is this all that is really necessary? Will the garbage disposal close everything else to free up RAM?

Also, if I have several forms open and want to close all from the main form without closing each one individually, what is the best approach? Is there a collection like in VB6, go through the collection, compare it to the name of the main form and close it if it is not the main form?

View 4 Replies

Main Form Is Closing By Itself After 15 Seconds

Mar 10, 2012

Everytime I execute my program, the main form closes by itself after about 15 seconds. The code is not the problem because it does the same thing when I put the whole code in comments. It's also not a key problem because it closes by itself even when I don't touch a single key when it's running.

View 1 Replies

Reload The Main Form Without Closing An Application?

Jun 12, 2009

I need to reload the form of my application. The application has only one form vb.net 2005. I need a button that will call the page_load event so I can restart and reload all my settings. basically I need to call the Sub private Page_load event().I just need to force the reloading of the form without having to close it and reopen it.This is the code which I need to reload:

Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each URLname As String In My.Settings.URLtoTrackCollection
URLtoTrack.Add(URLname)

[code]....

View 8 Replies

VS 2005 - Main Form Closing Immediately After Opening

Jan 27, 2011

I have created a splash screen and it fades in. When the splash screen closes, the main form (MDI) should open. The main form opens but then immediately closes.
vb
Public Class frmSplash
Private Sub frmSplash_FormClosing(ByVal sender As Object, _
ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
'Open the MDI form.
frmMain.Show()
End Sub
[Code] .....

View 3 Replies

.net - Closing Main Form Doesn't Finish Process In Windows 7?

Feb 23, 2011

I have an MDI form as the app start object.I don't think is related, but in the Form closing event, I check for some condition, and if it's true, I ask for confirmation before closing:

Private Sub FormBackground_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If (e.CloseReason = CloseReason.UserClosing) Then[code].....

So long, everything works fine in my development machine, which runs windows XP.However, when deploying the application in a windows 7 machine, the message box works correctly, showing itself whenever it should, but after the form is closed the application keeps running in the background. This happens whether the form closes directly or asks the user first.I have fixed it putting an End instruction in the FormBackground.FormClosed event, but it doesn't feel good.

View 4 Replies

Closing Login Form After User Is Authenticated

Sep 22, 2011

I have a very generic login form created that allows a user to access a application. My problem is getting the log in form to close after the application form is loaded. I have described the specifics in the comments of the code. [code]

View 1 Replies

IDE :: Main Form Is A Login Form If The USer And Password Matches

Mar 25, 2010

im trying to do where the main form is a login form if the USer and password matches that in the code it goes to the main screen if it doesent it launches a form saying this user and or password is incorrect and when you click ok it closes that message window as well as the login form stop the program from launching is has to match the user and password from the text on text box one and masked textbox 1.

View 3 Replies

How To Display Only Main Form After Login

May 18, 2009

sConn.Open()
lDA.SelectCommand = New SqlClient.SqlCommand("SELECT * FROM login WHERE username='" & TextBox1.Text.ToString & "' and userpassword='" & TextBox2.Text & "'", sConn)
lDS.Clear()
lDA.Fill(lDS)
If lDS.Tables(0).Rows.Count > 0 Then
[Code] .....
This is my code to enter login form and after that main form is opened. Still loginform is there. How to close the login form and display only main form after login successes.

View 14 Replies

Display The Main Form And Close The Login Form?

Sep 2, 2011

VS2010 VB.NET windows form app I have a login form that is my startup form.when uer hits OK I display the main form and close the login form, like this:

PrivateSub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
frmMain.Show()Me.Close()EndSub Problem is the application closes with me.close. Why? How can I close only the login form and leave the main form urnning???

View 3 Replies

Forms :: Add A Login Screen In Main Form

Mar 17, 2011

I've created a windows form application in vb 2010. I've got all my forms complete and now want to add a Login screen. One the login screen, after the username/password is entered and OK is pressed, I try to open the a connection string. Obviously if the connection fails, the user has entered the incorrect credentials. If the credentials are ok, True is returned and I then open up the Main form that shows the correct items for the logged in user.

[Code]...

View 5 Replies

Close Login And Open Main Window Form?

Feb 15, 2012

I am having a difficulty in this login form that I have made. The same as the premade template login in VB 2008 which I am using right now.Here's what happens when I run the program Log in form open > Log in successful > Main window appears *The login form still does not disappear.

I tried hiding it via me.hide() Log in form open > log in successful > Main window appears > log in form disappear.*Now the problem is that I cant close the whole application because the login form is still there only hidden. Again I tried putting in the "EXIT" button the code me.close() login.close()Log in form open > log in successful > Main window appears > log in form disappears > Exit application *Now everything seems to be ok now and then I found another problem.Instead of clicking the exit button I tried clicking the X button on the main window. There I found out that it only closes the main window. Therefore not closing the whole application because the login form is still hidden.

View 2 Replies

Showing Login Form Before Main Form

Aug 18, 2009

I'm sure I'm doing my login process for my app in a not so perfect way, but as with lots of things, it works. The issue is to make it work I have to use the very unpopular DoEvents thing. I would like my application to show a login screen before loading my main form. Currently I have a login dialog box with a FormOpen boolean property and an authenticated boolean property. If a user logs in successfully, I hide the login form, set formopen to false, and authenticated to true. If they cancel out, then I do the same and just set the authenticated property to false. If authenticated=false then I end the app, else I show the main form via application.run(MainForm)

[Code]...

View 3 Replies

VS 2008 - Bunch Of Errors - Main Login Box And Then Fail To Show The Main Screen

Jul 28, 2009

My app works fine on the development machine and 3 other machines. However, some machines just show the main login box and then fail to show the main screen. There is no error message. I installed VS 2008 express on on of such machines and when i compile the project, the following errors appear:

Type 'Microsoft.Office.Interop.Access.Application' is not defined.
Type 'dao.DBEngine' is not defined.

[CODE]..........................

View 3 Replies

Swapping User Controls - Closing Main Menu Screen?

Feb 19, 2010

I have a project (Written in Visual Basic, using Visual Studio 2005) which has several user controls. I have had no problem setting it up where you click a button and it load a user control, but I cannot get it to remove the control that is currently open. For example The program opens on a starts screen, which has the choices, Control1, Control2, and exit. When you click Control1 button it should open up a screen to display an inventory. It does this just fine, but it does not close the main menu screen.

Here is the code for the initial startup of the project:
Public Class Form4
Public Sub Form4Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim CtrlMain As New ControlMain()
With CtrlMain
.Location = New Point(0, 0
[Code] .....

View 7 Replies

Closing Child Form Without Closing The Parent?

Apr 27, 2011

I have the following code to close a form which is a child. The problem is that when it closes, it closes the MDI parent too.

Private Sub frmTransaction_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If ListView1.Items.Count >= 1 Then

[Code]....

View 4 Replies

VS 2010 - Hiding / Closing Login Forms?

May 1, 2012

I've created a program with a login form. Once you log in, the login form should close and the next form should display... my problem is...
If I use Me.Close()... than both forms close and the application terminates.
If I use Me.Hide()... than the application never unloads from memory and run indefinitely.
So what do I do? Neither of these work how I need them to.

View 3 Replies

[02/03] Login Screen Not Appearing Before Main Menu?

Jan 7, 2009

I'm creating a basic window's application where I have a login screen where the user will enter the userid/password etc. Only problem is when I try to run the application, it goes straight to the main menu.What would give the main menu precedance over the login screen?

View 5 Replies

IDE :: 2005 - Create A Login Form And Use A Text File As A Database To Login

Oct 10, 2010

I am currently working with VB.net 2005. I am trying to create a login form and use a text file as a database to login. The part login form is fine but i can't connected to the text file. When i use my coding with a database such as access or mysql is work fine.

[Code]...

View 4 Replies

VS 2008 Make Login Form That Will Login To A Website With WebBrowser Control

Feb 24, 2011

For the past couple of days I have been using Visual basic 2008 and learning it.Anyway, I am trying to make a login form that will login to a website with WebBrowser control.and I am noticing that the webbrowser is extremly slow, it takes him about 20 seconds to load a page while mozilla opens it in a moment, why is that?

View 6 Replies

Client-Server Login - Application That Will First Show Login Form (with Textbox For Username And Password)

Jul 31, 2010

I try to make one application that will first show login form (with textbox for username and password) and when I press login client application send request to server side application that make SQL query (local) and return some values and that values will be listed in main form. I try something with TCP chat source codes but I don't manage what I want.

View 3 Replies

Create A Login Verification Routine (Login Form) Connected To MS Access Database In The Server

Dec 9, 2009

How do I create a Login Verification routine (Login Form) in vb.net . i have an windows application with login form contain user name , password , ok button and cancel button .

as this one:

Imports System.Data.OleDb
Public Class LoginForm1
' OK button

[Code].....

but i want to run my application from desktop and will get confirmation if the user name and password correct by checking them in MS Access Database in the server.

so the the application in the desktop and the tabel of user name and password in the server.

View 12 Replies

Create A Login Verification Routine (Login Form) And Make Password Case Sensitive?

Apr 11, 2009

How do I create a Login Verification routine (Login Form) and make the password case sensitive?Please remember to mark the replies as answers if they help and unmark them if they provide no help.

View 3 Replies

Remember Login Info In Login Form

Jun 10, 2011

I have a login form with username and password authentication . It works fine. But I want to give option to remember login info option in the form.

View 7 Replies

Mdi Child Form Order - Move The New Form Behind The Main Form While It Loads

Aug 5, 2010

i have my main child form open. then i show the new form:

[Code]...

but when the form opens it flickers a lot. so i want move the new form behind the main form while it loads so the user does not see the flicker. once it is done loading i will set the form to topmost. how do i move the new form behind the main form?

View 12 Replies

Login Facility Reading In User Info From A Main User File?

Nov 9, 2011

I have been trying to solve this for 2 days now, every text book I own and google have been well and truely exhausted and I am still no closer to solving my problems.I have a login facility reading in user info from a main user file. This takes all info into a temp array and then splits usernames into a username file, passwords into a password file and a current score in a score file.

I have the login working fine and everything else in my program works as intended but touching up cosmetic aspects I want to add a Message box after login to say hello and display current score. This works great for the first name in the user file i.e - after login User1 welcome to the game. Your current score is 45 As intended.But the problem arises with any other users, my message comes out as

User2 welcome to the game. Your current score is 55 I do not understand where the random new lines are coming from. I have tried assigning the message as a variable and removing new line using

[Code]...

View 9 Replies

TopMost Form - Messages Form Would Be Hidden By The Main Form

Nov 20, 2009

I have a tool window that I want to stay above the main application form, but not stay on top of all windows forms. Similar to the floating properties window for visual studio - it always stays on top of the main VS window, but if I select another program, like internet explorer, the floating properties window will be behind internet explorer.

What I have is an application that has several forms that may be displayed at the same time. I have a Messages form that displays messages generated by the code in the form, that gives the status of the application. Obviously, the user would not normally be working on this form, but they may want it to be visible to see the status messages from the program (File saved confirmations, etc). So, my two options right now are I can set the form to be on top of all other windows forms or, when the user clicks on the main application form, the messages form would be hidden by the main form.

View 6 Replies

Vb6 LEGACY Application And New Functionality (Form) Written In C# - Closing The .net Form From Vb6

Feb 8, 2012

Alright, I have a vb6 LEGACY application and new Functionality (Form) written in c#. I have a VB.NET COM Class as a wrapper. I can launch the .NET Form just fine. THe problem I am having is closing the .net form from vb6.

Example:

In VB6, I have something like this:

CODE:

But it does not work becuase frmViewer is Nothing for some reason. how I should close the .NET form that was launched from VB6?

View 8 Replies

VS 2010 Child Form Tell Parent Form It Is Closing And Send ID?

Apr 2, 2012

I have a parent form that has a list of items and each item has a unique ID. The user can open one or many of the items in a child form (it is set up in a tabbed MDI), but it can only open one instance of each item at a time.

In the parent form, I was going to make a collection (or something like that, maybe there is a better way) to keep track of which items are open in the child forms. I need to know when each child is closed so that it can be removed from the collection and reopened at a later time. I was thinking that when the child form closes, it somehow does something (like raise an event) that tells the parent form to remove the unique ID from the list of current open child forms.

My questions are, is this a good way to do this and I am pretty sure I would use the form closed event in the child form to update that parent form, but as well, I didn't know if this is the best way of handling it.

If raising the event is a good way, are some examples on how to do it out there? I found some for controls, but not while the form is closing/closed.

View 4 Replies

Detail Bound Form Updates Main List Form, But Does Not Update Data

Jan 29, 2010

I have a main form with datagridview containing a list of contacts:

VB
Public Class Form1
Private Db As New DataClasses1DataContext
Private Sub Form1_Load

[Code]....

After saving, I get the correct message ("Saved"), and the DataGridView in the first form gets updated in real time.

But... when I take look at the data (or close and reopen the forms) the data in the database (SQL server) have not changed! What happens!

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved