6.14.frm
来自「vb编程+从基础到实践光盘代码」· FRM 代码 · 共 33 行
FRM
33 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3150
ClientLeft = 60
ClientTop = 390
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3150
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim X As Single, Y As Single, R As Single
If KeyCode = 65 And Shift = 2 Then '当按下Ctrl+A时,If语句的条件为True
X = ScaleWidth / 2 'X的值为当前窗体宽度的1/2
Y = ScaleHeight / 2 'Y的值为当前窗体高度的1/2
R = Y / 2
Circle (X, Y), R '以(X,Y)为圆心R为半径画圆
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 65 And Shift = 2 Then
MsgBox "你在窗体上画了一个圆"
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?