⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 自己在初学VB时写的有关Label控件的小例子
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00004080&
   Caption         =   "Form1"
   ClientHeight    =   4110
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7065
   LinkTopic       =   "Form1"
   ScaleHeight     =   4110
   ScaleWidth      =   7065
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command5 
      Caption         =   "设置边框"
      Height          =   495
      Left            =   4200
      TabIndex        =   5
      Top             =   3000
      Width           =   1335
   End
   Begin VB.CommandButton Command4 
      Caption         =   "自动调整大小"
      Height          =   495
      Left            =   2760
      TabIndex        =   4
      Top             =   3000
      Width           =   1335
   End
   Begin VB.CommandButton Command3 
      Caption         =   "文字可见"
      Height          =   495
      Left            =   1320
      TabIndex        =   3
      Top             =   3000
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "文字透明"
      Height          =   495
      Left            =   3360
      TabIndex        =   2
      Top             =   2280
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "显示世界杯"
      Height          =   495
      Left            =   1920
      TabIndex        =   1
      Top             =   2280
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "世界杯"
      Height          =   495
      Left            =   2280
      TabIndex        =   0
      Top             =   600
      Width           =   1935
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Label1.Caption = "世界杯"
End Sub

Private Sub Command2_Click()
If Label1.BackStyle = 1 Then
        Label1.BackStyle = 0
        Command2.Caption = "文字不透明"
    Else
        Label1.BackStyle = 1
        Command2.Caption = "文字透明"
    End If
End Sub

Private Sub Command3_Click()
If Label1.Visible = True Then
        Label1.Visible = False
        Command3.Caption = "文字可见"
    Else
        Label1.Visible = True
        Command3.Caption = "文字不可见"
    End If
End Sub

Private Sub Command4_Click()
    Label1.AutoSize = True
End Sub

Private Sub Command5_Click()
If Label1.BorderStyle = 0 Then
        Label1.BorderStyle = 1
        Command5.Caption = "隐藏边框"
    Else
        Label1.BorderStyle = 0
        Command5.Caption = "设置边框"
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -