This example uses two ComboBox controls to select different widths and styles for the borders of a Shape control. To try this example, paste the code into the Declarations section of a form that contains a Shape control and one ComboBox control. For the ComboBox, set Style = 2 and Index = 0 (to create a control array), and then press F5 and click the form.
Private Sub Form_Load ()
Combo1(0).Width = 1440 * 1.5
Load Combo1(1)
Combo1(1).Top = Combo1(0).Top + Combo1(0).Height * 1.5
Combo1(1).Visible = True
For I = 0 To 6
Combo1(0).AddItem "BorderStyle = " & I
Next I
For I = 1 To 10
Combo1(1).AddItem "BorderWidth = " & I
Next I
Combo1(0).ListIndex = 1
Combo1(1).ListIndex = 0
End Sub
Private Sub Combo1_Click (Index As Integer)
If Index = 0 Then
Shape1.BorderStyle = Combo1(0).ListIndex
Else
Shape1.BorderWidth = Combo1(1).ListIndex + 1
End If
End Sub