home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / design / 3dlook / main.frm next >
Text File  |  1995-02-26  |  5KB  |  158 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   4650
  6.    ClientLeft      =   3000
  7.    ClientTop       =   2325
  8.    ClientWidth     =   4110
  9.    FillColor       =   &H00FF0000&
  10.    FillStyle       =   0  'Solid
  11.    Height          =   5055
  12.    Left            =   2940
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   4650
  15.    ScaleWidth      =   4110
  16.    Top             =   1980
  17.    Width           =   4230
  18.    WindowState     =   2  'Maximized
  19.    Begin ListBox List1 
  20.       Height          =   2370
  21.       Left            =   1200
  22.       TabIndex        =   2
  23.       Tag             =   "OLU"
  24.       Top             =   3480
  25.       Width           =   2175
  26.    End
  27.    Begin TextBox Text2 
  28.       Height          =   375
  29.       Left            =   1440
  30.       TabIndex        =   1
  31.       Tag             =   "OLD"
  32.       Text            =   "Text2"
  33.       Top             =   1680
  34.       Width           =   1695
  35.    End
  36.    Begin TextBox Text1 
  37.       Height          =   375
  38.       Left            =   1440
  39.       TabIndex        =   0
  40.       Tag             =   "OLD"
  41.       Text            =   "Text1"
  42.       Top             =   840
  43.       Width           =   1695
  44.    End
  45.    Begin Label lblFrameLabel 
  46.       AutoSize        =   -1  'True
  47.       BackColor       =   &H00C0C0C0&
  48.       Caption         =   " Frame Label "
  49.       FontBold        =   0   'False
  50.       FontItalic      =   0   'False
  51.       FontName        =   "MS Sans Serif"
  52.       FontSize        =   9.75
  53.       FontStrikethru  =   0   'False
  54.       FontUnderline   =   0   'False
  55.       Height          =   240
  56.       Left            =   1440
  57.       TabIndex        =   6
  58.       Top             =   560
  59.       Width           =   1230
  60.    End
  61.    Begin Label Label1 
  62.       Alignment       =   2  'Center
  63.       BackColor       =   &H00C0C0C0&
  64.       Caption         =   "3D Label"
  65.       Height          =   195
  66.       Left            =   5520
  67.       TabIndex        =   5
  68.       Tag             =   "OLU"
  69.       Top             =   840
  70.       Width           =   1935
  71.    End
  72.    Begin Label lblPoint2 
  73.       Caption         =   "Label1"
  74.       Height          =   255
  75.       Left            =   7920
  76.       TabIndex        =   4
  77.       Top             =   5520
  78.       Visible         =   0   'False
  79.       Width           =   255
  80.    End
  81.    Begin Label lblPoint1 
  82.       Caption         =   "Label1"
  83.       Height          =   255
  84.       Left            =   4800
  85.       TabIndex        =   3
  86.       Top             =   480
  87.       Visible         =   0   'False
  88.       Width           =   255
  89.    End
  90. End
  91. Option Explicit
  92. '3D Frames, Panels, and Controls by Greg DeBacker
  93. 'These routines are free to use by anyone.
  94. 'Send comments to Greg DeBacker, CIS # 71042,36
  95.  
  96. 'There are 3 routines in the BAS file, THREED.BAS, that will make 3D Panels,
  97. '3D Frames, and 3D Controls. The first 2, DrawFrame and DrawPanel, I route.
  98.  
  99. 'The thrid, OutLines, was taken from the VisData sample that shipped with
  100. 'VB 3.0. However, I did make some modifications to this routine to allow for
  101. 'raised and recessed controls.
  102.  
  103. 'All of the routines in this sample are called from the Form_Paint event.
  104.  
  105. '****DrawFrame****
  106. '   The synatx for DrawFrame:
  107. '       DrawFrame Form to draw on, Control that will be in the upper_
  108. '                 left corner, Control that will be in the lower right_
  109. '                 corner, offset from the controls
  110. '
  111. 'I used a Label control for the frame label. If the label caption will be
  112. 'changing at run-time set the AutoSize property to True. It also looks better
  113. 'if you pad the caption with a leading and trailing space (Chr$(32)).
  114.  
  115. '****DrawPanel****
  116. '   The synatx for DrawPanel:
  117. '       DrawPanel Form to draw on, Control that will be in the upper_
  118. '                 left corner, Control that will be in the lower right_
  119. '                 corner, offset from the controls, thickness of the border
  120.  
  121.  
  122. '****OutLines****
  123. '   The synatx for OutLines:
  124. '       OutLines Form to draw on
  125. '
  126. '   The controls that you want to be 3Ded need to have their Tag property
  127. '   set. The two options are:
  128. '        Control.Tag = "OLD" (Out Line Down) Recessed
  129. '        Control.Tag = "OLU" (Out Line Up) Raised
  130.  
  131. Sub Form_Load ()
  132. BackColor = QBColor(7)
  133. Dim k%
  134. List1.AddItem "Raised List Box"
  135. For k% = 1 To 50
  136.     List1.AddItem "Item # " & Str$(k%)
  137. Next k%
  138. List1.ListIndex = 0
  139. End Sub
  140.  
  141. Sub Form_Paint ()
  142. ' Draw the panel for the 2 text boxes
  143. DrawFrame Me, Text1, Text2, 200
  144.  
  145. ' Draw the panel for the list box
  146. DrawFrame Me, List1, List1, 200
  147.  
  148. ' Draw using the two invisible Label controls as boundries
  149. DrawPanel Me, lblPoint1, lblPoint2, 200, 80
  150.  
  151. ' Draw the panel for the Label
  152. DrawPanel Me, Label1, Label1, 80, 40
  153.  
  154. 'Outline the controls
  155. OutLines Me
  156. End Sub
  157.  
  158.