0

当我尝试运行我的应用程序“应用程序不是我的成员”时出现此错误,我最近添加了一个启动画面,此错误来自下面的代码。我尝试从命令提示符运行 devenv.exe/resetsetting 以启用应用程序框架,但它不起作用。任何有更简单方法解决此问题的人将不胜感激

Imports System.Windows.Forms
Public NotInheritable Class SplashScreen1

'TODO: This form can easily be set as the splash screen 
'      for the application by going to the "Application" tab
'      of the Project Designer ("Properties" under the "Project" menu).

Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
    Handles Me.Load

    'Set up the dialog text at runtime according to
    'the application's assembly information.  

    'TODO: Customize the application's assembly information 
    '      in the "Application" pane of the project 
    '      properties dialog (under the "Project" menu).

    'Application title

    If True Then
        If Not String.IsNullOrEmpty(My.Application.Info.Title) Then
            ApplicationTitle.Text = My.Application.Info.Title
        Else
            'If the application title is missing, 
            'use the application name without the extension
            ApplicationTitle.Text = _
                System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If

        'Format the version information using the 
        'text set into the Version control at design time as the
        'formatting string. This allows for effective localization if desired.
        'Build and revision information could be included by 
        'using the following code and changing the version control's designtime 
        'text to "Version {0}.{1:00}.{2}.{3}" or something similar.  
        'See String.Format() in Help for more information.
        '
        'Version.Text = System.String.Format(Version.Text, _
        '                                    My.Application.Info.Version.Major, _
        '                                    My.Application.Info.Version.Minor, _
        '                                    My.Application.Info.Version.Build, _
        '                                    My.Application.Info.Version.Revision)

        Version.Text = System.[String].Format(Version.Text, _
                                              My.Application.Info.Version.Major, _
                                              My.Application.Info.Version.Minor)

        'Copyright info
        Copyright.Text = My.Application.Info.Copyright

    End If

End Sub
End Class
4

2 回答 2

1

在您的项目属性中尝试将您的启动表单设置为您的主表单并单击启用应用程序框架。然后您应该能够将 SplashScreen 设置为您的启动画面。确认您有如下代码:

Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    'Set up the dialog text at runtime according to the application's assembly information.  

    'TODO: Customize the application's assembly information in the "Application" pane of the project 
    '  properties dialog (under the "Project" menu).

    'Application title
    If My.Application.Info.Title <> "" Then
        ApplicationTitle.Text = My.Application.Info.Title
    Else
        'If the application title is missing, use the application name, without the extension
        ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
    End If

    Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)

    'Copyright info
    Copyright.Text = My.Application.Info.Copyright
End Sub
于 2013-08-31T03:13:12.723 回答
0

在我的项目中,如果有人感兴趣,它可以通过打开 project.vbproj 文件并更改:

<MyType>Empty</MyType>

<MyType>Windows</MyType>

而不是“WindowsForms”

于 2020-11-04T08:58:03.993 回答