简体   繁体   English

错误BC30456“表单”不是“ Windows”的成员

[英]Error BC30456 'Form' is not a member of 'Windows'

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 私有子Button1_Click(ByVal发送者作为System.Object,ByVal e作为System.EventArgs)处理Button1.Click

    With OpenFileDialog1
        .FileName = String.Empty
        .InitialDirectory = "C:\"
        .Title = "Open Excel File"
        .Filter = "Excel 97-2003|*.xls|Excel 2007|*.xlsx"
    End With
    Dim result As DialogResult = OpenFileDialog1.ShowDialog()
    If result = Windows.Form.DialogResult.OK Then
        Try
            TextBox1.Text = OpenFileDialog1.FileName
            GetExcelSheetNames(TextBox1.Text)
        Catch ex As Exception
            MsgBox("Error : " & ex.Message)
        End Try
    End If

End Sub
Public Class Form1
    Private loginLabel As String

    Public Sub New(ByVal loginParameter As String)
         InitializeComponent()

         Me.loginLabel = loginParameter

    End Sub
End Class

and in your login form: 并在您的登录表格中:

dim frm as new Form1(label.Text)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM