📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "MyCom Server Tester"
ClientHeight = 4380
ClientLeft = 60
ClientTop = 345
ClientWidth = 5370
Icon = "Form1.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4380
ScaleWidth = 5370
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame2
Caption = "Object 2"
Height = 3495
Left = 2820
TabIndex = 6
Top = 360
Width = 2235
Begin VB.CommandButton Command4
Caption = "Reset"
Height = 375
Left = 540
TabIndex = 13
Top = 2880
Width = 1155
End
Begin VB.TextBox Text3
Height = 315
Left = 240
TabIndex = 9
Text = "Text1"
Top = 660
Width = 1755
End
Begin VB.TextBox Text4
Height = 315
Left = 240
TabIndex = 8
Text = "25"
Top = 1680
Width = 1755
End
Begin VB.CommandButton Command3
Caption = "Raise"
Height = 375
Left = 540
TabIndex = 7
Top = 2280
Width = 1155
End
Begin VB.Label Label4
Caption = "Value:"
Height = 195
Left = 300
TabIndex = 11
Top = 420
Width = 675
End
Begin VB.Label Label3
Caption = "Raise Value:"
Height = 195
Left = 300
TabIndex = 10
Top = 1440
Width = 915
End
End
Begin VB.Frame Frame1
Caption = "Object 1"
Height = 3495
Left = 240
TabIndex = 0
Top = 360
Width = 2235
Begin VB.CommandButton Command2
Caption = "Reset"
Height = 375
Left = 540
TabIndex = 12
Top = 2880
Width = 1155
End
Begin VB.CommandButton Command1
Caption = "Raise"
Height = 375
Left = 540
TabIndex = 3
Top = 2280
Width = 1155
End
Begin VB.TextBox Text2
Height = 315
Left = 240
TabIndex = 2
Text = "10"
Top = 1680
Width = 1755
End
Begin VB.TextBox Text1
Height = 315
Left = 240
TabIndex = 1
Text = "Text1"
Top = 660
Width = 1755
End
Begin VB.Label Label2
Caption = "Raise Value:"
Height = 195
Left = 300
TabIndex = 5
Top = 1440
Width = 915
End
Begin VB.Label Label1
Caption = "Value:"
Height = 195
Left = 300
TabIndex = 4
Top = 420
Width = 675
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private MC1 As New MyCom ' declare MyCom objects
Private MC2 As New MyCom
Private Sub Command1_Click()
MC1.Raise (Text2) ' read the object value
Text1 = MC1.Value ' refresh the display
End Sub
Private Sub Command2_Click()
MC1.Value = 0 ' set the object value to zero
Text1 = MC1.Value ' refresh the display
End Sub
Private Sub Command3_Click()
MC2.Raise (Text4) ' read the object value
Text3 = MC2.Value ' refresh the display
End Sub
Private Sub Command4_Click()
MC2.Value = 0 ' set the object value to zero
Text3 = MC2.Value ' refresh the display
End Sub
Private Sub Form_Load()
Set MC1 = New MyCom ' create the objects
Set MC2 = New MyCom
MC1.Value = 100 ' set initial values
MC2.Value = 150
Text1 = MC1.Value ' refresh the displays
Text3 = MC2.Value
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -