form1.frm
来自「这里有很多很实用的VB编程案例,方便大家学习VB.」· FRM 代码 · 共 88 行
FRM
88 行
VERSION 5.00
Begin VB.Form Form1
Caption = "按钮"
ClientHeight = 3960
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3960
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command5
Caption = "设置按钮按下时的图片"
Height = 495
Left = 840
Style = 1 'Graphical
TabIndex = 4
Top = 3240
Width = 2895
End
Begin VB.CommandButton Command4
Caption = "设置按钮无效时的图片"
Height = 495
Left = 840
Style = 1 'Graphical
TabIndex = 3
Top = 2520
Width = 2895
End
Begin VB.CommandButton Command3
Caption = "&Cancel"
Height = 495
Left = 840
Style = 1 'Graphical
TabIndex = 2
Top = 1080
Width = 2895
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0C0&
Cancel = -1 'True
Caption = "改变按钮风格"
Height = 495
Left = 840
Style = 1 'Graphical
TabIndex = 1
Top = 1800
Width = 2895
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 840
TabIndex = 0
Top = 360
Width = 2895
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()
Command1.Caption = "你已经单击过这个按钮了"
Command1.Enabled = False
End Sub
Private Sub Command2_Click()
Command2.BackColor = &HFF&
Command3.Picture = LoadPicture(App.Path + "\fj15.jpg")
End Sub
Private Sub Command3_Click()
MsgBox "你取消操作"
End Sub
Private Sub Command4_Click()
Command4.DisabledPicture = LoadPicture(App.Path + "\fj15.jpg")
Command4.Enabled = False
End Sub
Private Sub Command5_Click()
Command5.Picture = LoadPicture(App.Path + "\mac243.jpg")
Command5.DownPicture = LoadPicture(App.Path + "\fj15.jpg")
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?