本文介绍了单击按钮打开MDIPARENT表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个登录表单,并且在身份验证后单击确定"后,它应该打开我的主表单(这是MDIParent).我尝试了所有可能的方式,但无法做到这一点.有人可以帮我吗?

Hello All,

I have a login form and after authenticationm when I click on OK, it should open my Main form(which is a MDIParent). I tried in all possible ways but am unable to do that. Can anyone help me with this?

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
        Try
            Dim AuthData As New GetData.GetData()
            Dim DT As DataTable = AuthData.GetAuthentication(UsernameTextBox.Text, PasswordTextBox.Text)
            Dim Password As String = DT.Rows(0).Item(0).ToString
            If (Password = PasswordTextBox.Text) Then
                MsgBox("Login Successful")
                Me.Close()
                MainForm.Show()
            Else
                MsgBox("Invalid Password. Please Try Again")
            End If
        Catch EX As Exception
            MsgBox("UserName Not Registered. Please enter a Valid Username and Continue")
        End Try
    End Sub



MainForm是一个MDI容器,我要在成功登录后尝试打开它.
请帮助我.



MainForm is a MDI Container which i am trying to open after successful login.
Please Help Me.

推荐答案


这篇关于单击按钮打开MDIPARENT表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 22:52
查看更多