Link to home
Start Free TrialLog in
Avatar of Ron Kidd
Ron KiddFlag for Australia

asked on

Login Form in Seperate Project vb.net

Hello

I have a Login form in one Project and an Application as a Separate Project.

How do I make the Login form open the Form in the Application Project, Pass the Credentials then Close?
I need the Login form to be reshown at anytime to change the Logged in User.

I have tried Setting a Public Sub in the Application Project with the Credentials as Parameters and calling that sub from the Login From/Project.
That works except the Login Form remains on the Screen. If I close the Login form then the whole thing closes including the Application form.

If I hide the Login Form then how can I show it again to change Users? (It is in another Project)

Login Form Code
 
Imports XYZBLL
Public Class LogInForm
	Dim cutToLengthForm As New XYZ.CutToLength
    Private Sub LoginButtonClicked(sender As Object, e As EventArgs) Handles Staff1Button.Click, Staff2Button.Click, Staff3Button.Click,
                                                                            Staff4Button.Click, Staff5Button.Click, Staff6Button.Click

		cutToLengthForm.NewCutToLength(sender.text, sender.tag)
    End Sub
End Class

Open in new window


Application From Code
Imports XYZBLL
Public Class CutToLength
    Public Sub NewCutToLength(ByVal staffName As String, ByVal staffID As Integer)
        LoggedInStaffLabel.Text = staffName
        LoggedInStaffLabel.Tag = staffID
        Me.Show()
    End Sub
End Class

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ron Kidd

ASKER

Thanks

Simple and effective.

Thanks again