运行效果:
程序代码:
Private Type num '定义一个新类型的数据,包含两个元素
num1 As Integer
num2 As Integer
End Type
Private Sub Command1_Click()
Dim number As num '定义num类型的变量
number.num1 = 1
number.num2 = 2
Text1.Text = number.num1 + number.num2
运行效果:
程序代码:
Private Type num '定义一个新类型的数据,包含两个元素
num1 As Integer
num2 As Integer
End Type
Private Sub Command1_Click()
Dim number As num '定义num类型的变量
number.num1 = 1
number.num2 = 2
Text1.Text = number.num1 + number.num2