【问题标题】:Hide default version in splash screen在初始屏幕中隐藏默认版本
【发布时间】:2013-08-31 21:24:30
【问题描述】:

我在 vb.net 上加载程序时显示了一个启动画面。 我有一个自定义图像,可以显示我需要的所有内容,所以我想隐藏程序的默认版本

我有以下代码:

Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' General Information about an assembly is controlled through the following 
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.

' Review the values of the assembly attributes

<Assembly: AssemblyTitle(" ")> 
<Assembly: AssemblyDescription(" ")> 
<Assembly: AssemblyCompany(" ")> 
<Assembly: AssemblyProduct(" ")> 
<Assembly: AssemblyCopyright(" ")> 
<Assembly: AssemblyTrademark(" ")> 

<Assembly: ComVisible(False)>

'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("bad8ba80-e893-4480-a4b4-5c9a91751386")> 

' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version 
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Build and Revision Numbers 
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> 

<Assembly: AssemblyVersion("0")> 
<Assembly: AssemblyFileVersion(" 0")> 

我试过评论AssemblyVersionAssemblyFileVersion,我也试过删除它们,但它仍然出现。

如何隐藏程序的默认版本?

【问题讨论】:

  • 不要像这样编辑 AssemblyInfo.vb 文件,这些属性很重要。改为编辑启动画面。您可以随意更改其代码。如果要隐藏显示的版本号,只需将 Label 的 Visible 属性设置为 False。

标签: vb.net winforms splash-screen


【解决方案1】:

假设您使用 SplashForm,您可以执行两件事。您可以删除版本控制和任何其他内容并删除引用的代码行,或者您可以将它们的可见性正确设置为 false。

Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   If My.Application.Info.Title <> "" Then
        ApplicationTitle.Text = My.Application.Info.Title
    Else
        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)
    'Set Version controls visible property to false.
    Version.Visible = False

    Copyright.Text = My.Application.Info.Copyright
End Sub

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-05
    • 1970-01-01
    • 2013-11-02
    • 2018-12-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多