' Create a new address tab.
Private Sub cmdAddTab_Click()
Dim frame_index As Integer
Dim cbo_item As Integer
' Create the new tab.
tabSections.Tabs.Add , , "Address " & _
Format$(tabSections.Tabs.Count + 1)
' Create the new frame.
frame_index = tabSections.Tabs.Count - 1
Load fraTab(frame_index)
' Make the new frame set on top of the TabStrip.
fraTab(frame_index).ZOrder
' Position the frame over the TabStrip.
PositionFrame fraTab(frame_index)
' Make the new fields for the frame.
Load lblName(frame_index)
With lblName(frame_index)
Set .Container = fraTab(frame_index)
.Move lblName(0).Left, lblName(0).Top
.Visible = True
End With
Load lblAddress(frame_index)
With lblAddress(frame_index)
Set .Container = fraTab(frame_index)
.Move lblAddress(0).Left, lblAddress(0).Top
.Visible = True
End With
Load lblCity(frame_index)
With lblCity(frame_index)
Set .Container = fraTab(frame_index)
.Move lblCity(0).Left, lblCity(0).Top
.Visible = True
End With
Load lblState(frame_index)
With lblState(frame_index)
Set .Container = fraTab(frame_index)
.Move lblState(0).Left, lblState(0).Top
.Visible = True
End With
Load lblZip(frame_index)
With lblZip(frame_index)
Set .Container = fraTab(frame_index)
.Move lblZip(0).Left, lblZip(0).Top
.Visible = True
End With
Load txtName(frame_index)
With txtName(frame_index)
Set .Container = fraTab(frame_index)
.Move txtName(0).Left, txtName(0).Top
.Visible = True
End With
Load txtAddress(frame_index)
With txtAddress(frame_index)
Set .Container = fraTab(frame_index)
.Move txtAddress(0).Left, txtAddress(0).Top
.Visible = True
End With
Load txtCity(frame_index)
With txtCity(frame_index)
Set .Container = fraTab(frame_index)
.Move txtCity(0).Left, txtCity(0).Top
.Visible = True
End With
Load cboState(frame_index)
With cboState(frame_index)
Set .Container = fraTab(frame_index)
.Move cboState(0).Left, cboState(0).Top
For cbo_item = 0 To cboState(0).ListCount - 1
.AddItem cboState(0).List(cbo_item)
Next cbo_item
.Visible = True
End With
Load txtZip(frame_index)
With txtZip(frame_index)
Set .Container = fraTab(frame_index)
.Move txtZip(0).Left, txtZip(0).Top
.Visible = True
End With
End Sub
|