home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form CLoadForm
- Caption = "Loading Controls at Run-Time"
- ClientHeight = 3660
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6750
- LinkTopic = "Form1"
- ScaleHeight = 3660
- ScaleWidth = 6750
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command1
- Caption = "Fill this Form"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 480
- Left = 195
- TabIndex = 2
- Top = 2910
- Width = 1500
- End
- Begin VB.TextBox TextBoxes
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 300
- Index = 0
- Left = 2085
- TabIndex = 1
- Top = 15
- Visible = 0 'False
- Width = 3060
- End
- Begin VB.Label Labels
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 300
- Index = 0
- Left = 150
- TabIndex = 0
- Top = 30
- Visible = 0 'False
- Width = 1785
- End
- Attribute VB_Name = "CLoadForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- Dim Captions(10) As String
- Dim Sizes(10) As Integer
- Captions(1) = "Last Name"
- Captions(2) = "First Name"
- Captions(3) = "Address"
- Captions(4) = "City"
- Captions(5) = "State-ZIP"
- Sizes(1) = 20
- Sizes(2) = 30
- Sizes(3) = 40
- Sizes(4) = 15
- Sizes(5) = 12
- For i = 1 To 5
- Load Labels(i)
- Load TextBoxes(i)
- Labels(i).Top = Labels(i - 1).Top + 1.5 * Labels(0).Height
- Labels(i).Left = Labels(0).Left
- TextBoxes(i).Top = TextBoxes(i - 1).Top + 1.5 * TextBoxes(i).Height
- TextBoxes(i).Left = TextBoxes(0).Left
- TextBoxes(i).Width = Sizes(i) * TextWidth("A")
- Labels(i).Caption = Captions(i)
- Labels(i).Visible = True
- TextBoxes(i).Visible = True
- End Sub
-