home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / truegrid / disk1 / vsdemo / vsdemo.$ / FPROP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-09  |  4.2 KB  |  125 lines

  1. VERSION 2.00
  2. Begin Form fProp 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00C0C0C0&
  5.    Caption         =   "Proportional Resizing : Resize the form"
  6.    ClientHeight    =   4365
  7.    ClientLeft      =   570
  8.    ClientTop       =   1590
  9.    ClientWidth     =   5925
  10.    ClipControls    =   0   'False
  11.    Height          =   4830
  12.    Left            =   480
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   218.25
  15.    ScaleMode       =   2  'Point
  16.    ScaleWidth      =   296.25
  17.    Top             =   1215
  18.    Width           =   6105
  19.    Begin VideoSoftElastic VSElastic1 
  20.       Align           =   5  'Fill Container
  21.       AutoSizeChildren=   7  'Proportional (Locks Controls)
  22.       BevelInner      =   0  'None
  23.       BevelInnerWidth =   4
  24.       BevelOuter      =   1  'Raised
  25.       BevelOuterWidth =   1
  26.       ConvInfo        =   FPROP.FRX:0000
  27.       Height          =   4365
  28.       IntBkg          =   &H00C0C0C0&
  29.       Left            =   0
  30.       TabIndex        =   0
  31.       Top             =   0
  32.       Width           =   5925
  33.       Begin VideoSoftElastic VSElastic2 
  34.          AutoSizeChildren=   1  'Even Horizontal
  35.          BevelInner      =   0  'None
  36.          BevelInnerWidth =   3
  37.          BevelOuter      =   0  'None
  38.          BorderWidth     =   -1
  39.          ConvInfo        =   FPROP.FRX:000B
  40.          Height          =   1230
  41.          IntBkg          =   &H00C0C0C0&
  42.          Left            =   600
  43.          TabIndex        =   4
  44.          Top             =   1020
  45.          Width           =   1215
  46.          Begin Image Image1 
  47.             Height          =   1260
  48.             Left            =   -15
  49.             Picture         =   FPROP.FRX:0016
  50.             Stretch         =   -1  'True
  51.             Top             =   -15
  52.             Width           =   1245
  53.          End
  54.       End
  55.       Begin CheckBox Check1 
  56.          BackColor       =   &H00C0C0C0&
  57.          Caption         =   "Lock Font Size"
  58.          FontBold        =   -1  'True
  59.          FontItalic      =   0   'False
  60.          FontName        =   "Arial"
  61.          FontSize        =   12
  62.          FontStrikethru  =   0   'False
  63.          FontUnderline   =   0   'False
  64.          ForeColor       =   &H00800000&
  65.          Height          =   540
  66.          Left            =   3045
  67.          TabIndex        =   3
  68.          Top             =   3390
  69.          Width           =   2490
  70.       End
  71.       Begin CommandButton Command1 
  72.          BackColor       =   &H00C0C0C0&
  73.          Caption         =   "&Help"
  74.          FontBold        =   -1  'True
  75.          FontItalic      =   0   'False
  76.          FontName        =   "Arial"
  77.          FontSize        =   12
  78.          FontStrikethru  =   0   'False
  79.          FontUnderline   =   0   'False
  80.          Height          =   735
  81.          Left            =   255
  82.          TabIndex        =   2
  83.          Top             =   3315
  84.          Width           =   2310
  85.       End
  86.       Begin TextBox Text1 
  87.          Alignment       =   2  'Center
  88.          BackColor       =   &H00C0C0C0&
  89.          FontBold        =   -1  'True
  90.          FontItalic      =   0   'False
  91.          FontName        =   "Arial"
  92.          FontSize        =   12
  93.          FontStrikethru  =   0   'False
  94.          FontUnderline   =   0   'False
  95.          ForeColor       =   &H00800000&
  96.          Height          =   2250
  97.          Left            =   2160
  98.          MultiLine       =   -1  'True
  99.          TabIndex        =   1
  100.          Text            =   "Proportional Resizing locks the controls in place at design time"
  101.          Top             =   525
  102.          Width           =   3330
  103.       End
  104.    End
  105. Option Explicit
  106. Dim oh     'original height
  107. Sub Command1_Click ()
  108.   MsgBox "This is done with only one elastic that fills the container and its AutoSizeChildren property set to proportional"
  109. End Sub
  110. Sub Form_Load ()
  111.   oh = vsElastic1.Height
  112. End Sub
  113. Sub Form_Resize ()
  114.   'Code to Change fonts when form is resized
  115.   Dim I%
  116.   On Error Resume Next
  117.   If check1.Value Then Exit Sub
  118.   For I = 0 To Controls.Count - 1
  119.     Controls(I).FontSize = 12 * (vsElastic1.Height / oh)
  120.     Controls(I).FontName = "Arial"
  121.     Controls(I).FontName = True
  122.   Next I
  123.   'oh = vselastic1.Height
  124. End Sub
  125.