Avatar of p-plater
p-plater
Flag 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

Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
p-plater

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
p-plater

ASKER
Thanks

Simple and effective.

Thanks again
Your help has saved me hundreds of hours of internet surfing.
fblack61