0

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.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by vampke
0

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
0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.