Hello good people of vb.net,

I'm experiencing problems with an application I'm writing.
I have a login dialog that is loaded in the main form's load property, like this:

Private Sub FrmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' show login if configured
        If My.Settings.login Then
            Me.Visible = False
            Dim dlg As New frmLogin
            dlg.Show()
        End If
    End Sub

I make the main form visible from the login dialog if the login is correct. This works perfectly in another app I've written.
In this one the main form automatically gets set to visible again after FrmMain_Load is finished. I am cluelees to why this might be.
I have been trying things with a splash screen, maybe something went wrong there, but I can't find what. Disabling the splashscreen all together doesn't do much good either.
Anyone know where to look?

v.

Recommended Answers

All 2 Replies

Use ShowDialog() Method,

Private Sub FrmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        SplashForm.ShowDialog()  'Use Timer's event to close this form.
        frmLogin.ShowDialog()
    End Sub

Excellent! This solved the issue.
Would you mind explaining why this problem occurs?

edit: hmmm... apparently I cannot get the splashscreen like I want now.
Would you care to give me another pointer for that?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.