'定義過(guò)id痒筒,添加控件
Sub AddControls()
Dim options As Integer
Dim leftAlign As Integer
Dim controlType As Integer
'新建三個(gè)組
options = swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded + swAddGroupBoxOptions_e.swGroupBoxOptions_Visible
group1 = ppage.AddGroupBox(group1ID, "長(zhǎng)", options)
options = swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded + swAddGroupBoxOptions_e.swGroupBoxOptions_Visible
group2 = ppage.AddGroupBox(group2ID, "寬", options)
options = swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded + swAddGroupBoxOptions_e.swGroupBoxOptions_Visible
group3 = ppage.AddGroupBox(group1ID, "厚", options)
'添加控件到組一
'數(shù)字輸入框Num1
controlType = swPropertyManagerPageControlType_e.swControlType_Numberbox
leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
num1 = group1.AddControl(num1ID, controlType, "Sample Numberbox", leftAlign, options, "Allows numerical input")
If Not num1 Is Nothing Then
num1.SetRange(swNumberboxUnitType_e.swNumberBox_Length, 100.0, 0.0, 0.01, True)
num1.Value = 0.05
End If
'添加控件到組2
'數(shù)字輸入框Num2
controlType = swPropertyManagerPageControlType_e.swControlType_Numberbox
leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
num2 = group2.AddControl(num2ID, controlType, "Sample Numberbox", leftAlign, options, "Allows numerical input")
If Not num2 Is Nothing Then
num2.SetRange(swNumberboxUnitType_e.swNumberBox_Length, 100.0, 0.0, 0.01, True)
num2.Value = 0.05
End If
'添加組件到組3
'Num3
controlType = swPropertyManagerPageControlType_e.swControlType_Numberbox
leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
num3 = group3.AddControl(num3ID, controlType, "Sample Numberbox", leftAlign, options, "Allows numerical input")
If Not num3 Is Nothing Then
num3.SetRange(swNumberboxUnitType_e.swNumberBox_Length, 100.0, 0.0, 0.01, True)
num3.Value = 0.01
End If
End Sub
這是添加了三個(gè)數(shù)字輸入框控件