home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch04 / cload / cload.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-03-07  |  2.9 KB  |  96 lines

  1. VERSION 5.00
  2. Begin VB.Form CLoadForm 
  3.    Caption         =   "Loading Controls at Run-Time"
  4.    ClientHeight    =   3660
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   6750
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3660
  10.    ScaleWidth      =   6750
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command1 
  13.       Caption         =   "Fill this Form"
  14.       BeginProperty Font 
  15.          Name            =   "Verdana"
  16.          Size            =   9.75
  17.          Charset         =   0
  18.          Weight          =   400
  19.          Underline       =   0   'False
  20.          Italic          =   0   'False
  21.          Strikethrough   =   0   'False
  22.       EndProperty
  23.       Height          =   480
  24.       Left            =   195
  25.       TabIndex        =   2
  26.       Top             =   2910
  27.       Width           =   1500
  28.    End
  29.    Begin VB.TextBox TextBoxes 
  30.       BeginProperty Font 
  31.          Name            =   "Verdana"
  32.          Size            =   9
  33.          Charset         =   0
  34.          Weight          =   400
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       Height          =   300
  40.       Index           =   0
  41.       Left            =   2085
  42.       TabIndex        =   1
  43.       Top             =   15
  44.       Visible         =   0   'False
  45.       Width           =   3060
  46.    End
  47.    Begin VB.Label Labels 
  48.       Alignment       =   1  'Right Justify
  49.       BeginProperty Font 
  50.          Name            =   "Verdana"
  51.          Size            =   9
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   300
  59.       Index           =   0
  60.       Left            =   150
  61.       TabIndex        =   0
  62.       Top             =   30
  63.       Visible         =   0   'False
  64.       Width           =   1785
  65.    End
  66. Attribute VB_Name = "CLoadForm"
  67. Attribute VB_GlobalNameSpace = False
  68. Attribute VB_Creatable = False
  69. Attribute VB_PredeclaredId = True
  70. Attribute VB_Exposed = False
  71. Private Sub Command1_Click()
  72. Dim Captions(10) As String
  73. Dim Sizes(10) As Integer
  74. Captions(1) = "Last Name"
  75. Captions(2) = "First Name"
  76. Captions(3) = "Address"
  77. Captions(4) = "City"
  78. Captions(5) = "State-ZIP"
  79. Sizes(1) = 20
  80. Sizes(2) = 30
  81. Sizes(3) = 40
  82. Sizes(4) = 15
  83. Sizes(5) = 12
  84. For i = 1 To 5
  85.     Load Labels(i)
  86.     Load TextBoxes(i)
  87.     Labels(i).Top = Labels(i - 1).Top + 1.5 * Labels(0).Height
  88.     Labels(i).Left = Labels(0).Left
  89.     TextBoxes(i).Top = TextBoxes(i - 1).Top + 1.5 * TextBoxes(i).Height
  90.     TextBoxes(i).Left = TextBoxes(0).Left
  91.     TextBoxes(i).Width = Sizes(i) * TextWidth("A")
  92.     Labels(i).Caption = Captions(i)
  93.     Labels(i).Visible = True
  94.     TextBoxes(i).Visible = True
  95. End Sub
  96.