📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "属性到图形"
ClientHeight = 4575
ClientLeft = 60
ClientTop = 450
ClientWidth = 4020
LinkTopic = "Form3"
ScaleHeight = 4575
ScaleWidth = 4020
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo2
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 2040
TabIndex = 4
Text = "Combo2"
Top = 1440
Width = 1935
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 2160
TabIndex = 3
Text = "Combo1"
Top = 480
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "Search"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 720
TabIndex = 1
Top = 2520
Width = 1575
End
Begin VB.Label Label2
Caption = "ID号"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 2
Top = 1440
Width = 1455
End
Begin VB.Label Label1
Caption = "图形类型"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 0
Top = 480
Width = 1335
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Combo1_Click()
Me.Combo2.Clear
'---------选中点----------
If Me.Combo1.ListIndex = 0 Then
Dim i As Long
i = 0
Dim p As CPoint
For i = 1 To PntArray.Count
Set p = PntArray.Item(i)
Me.Combo2.AddItem p.ID
Next
Set p = Nothing
End If
'----------选中Line--------------
If Me.Combo1.ListIndex = 1 Then
Dim j As Long
j = 0
Dim l As CLine
For j = 1 To LineArray.Count
Set l = LineArray.Item(j)
Me.Combo2.AddItem l.ID
Next
Set l = Nothing
End If
'------------------------选中 rec-------------------
If Me.Combo1.ListIndex = 2 Then
Dim m As Long
m = 0
Dim r As CRec
For m = 1 To RecArray.Count
Set r = RecArray.Item(m)
Me.Combo2.AddItem r.ID
Next
Set r = Nothing
End If
'----------选中Circle--------------
If Me.Combo1.ListIndex = 3 Then
Dim n As Long
n = 0
Dim c As CCircle
For n = 1 To CircleArray.Count
Set c = CircleArray.Item(n)
Me.Combo2.AddItem c.ID
Next
Set c = Nothing
End If
End Sub
Private Sub Command1_Click()
'==========================search point=======================
If Me.Combo1.ListIndex = 0 Then
nselectid = Val(Me.Combo2.Text)
nSelectType = 1
Form1.Timer1.Enabled = True
End If
'==========================search line===========================
If Me.Combo1.ListIndex = 1 Then
nselectidl = Val(Me.Combo2.Text)
nSelectType = 2
Form1.Timer1.Enabled = True
End If
'===========================search rec===========================
If Me.Combo1.ListIndex = 2 Then
nselectidr = Val(Me.Combo2.Text)
nSelectType = 3
Form1.Timer1.Enabled = True
End If
'==========================search circle=========================
If Me.Combo1.ListIndex = 3 Then
nselectidc = Val(Me.Combo2.Text)
nSelectType = 4
Form1.Timer1.Enabled = True
End If
End Sub
Private Sub Form_Load()
Me.Combo1.AddItem "Point"
Me.Combo1.AddItem "Line"
Me.Combo1.AddItem "Rec"
Me.Combo1.AddItem "Circle"
Me.Combo1.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -