form1.frm
来自「大量优秀的vb编程」· FRM 代码 · 共 212 行
FRM
212 行
VERSION 5.00
Begin VB.Form Form1
AutoRedraw = -1 'True
BackColor = &H80000000&
Caption = "透明按钮"
ClientHeight = 3360
ClientLeft = 60
ClientTop = 348
ClientWidth = 5400
LinkTopic = "Form1"
ScaleHeight = 280
ScaleMode = 3 'Pixel
ScaleWidth = 450
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox b1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00E0E0E0&
BorderStyle = 0 'None
BeginProperty Font
Name = "Times New Roman"
Size = 11.4
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 828
Left = 3120
ScaleHeight = 69
ScaleMode = 3 'Pixel
ScaleWidth = 79
TabIndex = 4
Top = 600
Width = 948
End
Begin VB.PictureBox b2
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00E0E0E0&
BorderStyle = 0 'None
BeginProperty Font
Name = "Verdana"
Size = 14.4
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 828
Left = 1920
ScaleHeight = 69
ScaleMode = 3 'Pixel
ScaleWidth = 79
TabIndex = 3
Top = 600
Width = 948
End
Begin VB.PictureBox b3
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00E0E0E0&
BorderStyle = 0 'None
BeginProperty Font
Name = "Arial"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 708
Left = 1080
ScaleHeight = 59
ScaleMode = 3 'Pixel
ScaleWidth = 97
TabIndex = 2
Top = 1800
Width = 1164
End
Begin VB.PictureBox b5
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
BeginProperty Font
Name = "Tahoma"
Size = 11.4
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF80&
Height = 684
Left = 2880
ScaleHeight = 57
ScaleMode = 3 'Pixel
ScaleWidth = 97
TabIndex = 1
Top = 1800
Width = 1164
End
Begin VB.PictureBox b4
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00E0E0E0&
BorderStyle = 0 'None
BeginProperty Font
Name = "Tahoma"
Size = 11.4
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 828
Left = 720
ScaleHeight = 69
ScaleMode = 3 'Pixel
ScaleWidth = 89
TabIndex = 0
Top = 600
Width = 1068
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Button1 As New clsButton
Dim Button2 As New clsButton
Dim Button3 As New clsButton
Dim Button4 As New clsButton
Dim Button5 As New clsButton
Private Sub Command1_Click()
dT = Timer()
Button1.InitButton b1, "ONE", False, 0.5, 10, 10, True
Button2.InitButton b2, "TWO", True, 0.75, 10, 10, False
Button3.InitButton b3, "THREE", True, 0.5, 5, 5, True
Button4.InitButton b4, "FOUR", False, 0.5, 12, 20, False
Button5.InitButton b5, "FIVE", True, 0.75, 15, 5, True
Me.Caption = Timer - dT
End Sub
Private Sub Command2_Click()
Me.Caption = Button5.InitButton(b5, "FOUR", True, 0.5, 12, 20, False)
End Sub
Private Sub b1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Button1.TriggerButton
End Sub
Private Sub b2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Button2.TriggerButton
End Sub
Private Sub b3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Button3.TriggerButton
End Sub
Private Sub b4_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Button4.TriggerButton
End Sub
Private Sub b5_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Button5.TriggerButton
End Sub
Private Sub Form_Load()
Button1.InitButton b1, "ONE", False, 0.75, 15, 0, True
Button2.InitButton b2, "TWO", True, 0.75, 10, 10, False
Button3.InitButton b3, "THREE", True, 0.75, 10, 5, True
Button4.InitButton b4, "FOUR", True, 0.75, 12, 12, False
Button5.InitButton b5, "FIVE", False, 0.75, 5, 5, True
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?