例[11-4].frm

来自「蒋加伏主编VB程序设计第四版PPT及全部课本源码 北京邮电大学出版社 」· FRM 代码 · 共 34 行

FRM
34
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "例[11-4] 鼠标事件"
   ClientHeight    =   2070
   ClientLeft      =   60
   ClientTop       =   240
   ClientWidth     =   3645
   LinkTopic       =   "Form1"
   ScaleHeight     =   2070
   ScaleWidth      =   3645
   StartUpPosition =   3  '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim StartX, StartY As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
 StartX = X
 StartY = Y
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
 Dim R As Integer, Color As Integer
 Dim EndX, EndY As Integer
 EndX = X
 EndY = Y
 Color = Int(16 * Rnd)
 R = Sqr((EndX - StartX) ^ 2 + (EndY - StartY) ^ 2)
 Form1.Circle (StartX, StartY), R, QBColor(Color)
End Sub

⌨️ 快捷键说明

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