home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / 3CTRLS / FPROP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-04-01  |  4.0 KB  |  120 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
  22.       BevelInner      =   0  'None
  23.       BevelInnerWidth =   4
  24.       BevelOuter      =   1  'Raised
  25.       BevelOuterWidth =   1
  26.       Height          =   4365
  27.       Left            =   0
  28.       TabIndex        =   0
  29.       Top             =   0
  30.       Width           =   5925
  31.       Begin VideoSoftElastic VSElastic2 
  32.          AutoSizeChildren=   1  'Even Horizontal
  33.          BevelInner      =   0  'None
  34.          BevelInnerWidth =   3
  35.          BevelOuter      =   0  'None
  36.          BorderWidth     =   -1
  37.          Height          =   1230
  38.          Left            =   600
  39.          TabIndex        =   4
  40.          Top             =   1020
  41.          Width           =   1215
  42.          Begin Image Image1 
  43.             Height          =   1260
  44.             Left            =   -15
  45.             Picture         =   FPROP.FRX:0000
  46.             Stretch         =   -1  'True
  47.             Top             =   -15
  48.             Width           =   1245
  49.          End
  50.       End
  51.       Begin CheckBox Check1 
  52.          BackColor       =   &H00C0C0C0&
  53.          Caption         =   "Lock Font Size"
  54.          FontBold        =   -1  'True
  55.          FontItalic      =   0   'False
  56.          FontName        =   "Arial"
  57.          FontSize        =   12
  58.          FontStrikethru  =   0   'False
  59.          FontUnderline   =   0   'False
  60.          ForeColor       =   &H00800000&
  61.          Height          =   540
  62.          Left            =   3045
  63.          TabIndex        =   3
  64.          Top             =   3390
  65.          Width           =   2490
  66.       End
  67.       Begin CommandButton Command1 
  68.          BackColor       =   &H00C0C0C0&
  69.          Caption         =   "&Help"
  70.          FontBold        =   -1  'True
  71.          FontItalic      =   0   'False
  72.          FontName        =   "Arial"
  73.          FontSize        =   12
  74.          FontStrikethru  =   0   'False
  75.          FontUnderline   =   0   'False
  76.          Height          =   735
  77.          Left            =   255
  78.          TabIndex        =   2
  79.          Top             =   3315
  80.          Width           =   2310
  81.       End
  82.       Begin TextBox Text1 
  83.          Alignment       =   2  'Center
  84.          BackColor       =   &H00C0C0C0&
  85.          FontBold        =   -1  'True
  86.          FontItalic      =   0   'False
  87.          FontName        =   "Arial"
  88.          FontSize        =   12
  89.          FontStrikethru  =   0   'False
  90.          FontUnderline   =   0   'False
  91.          ForeColor       =   &H00800000&
  92.          Height          =   2250
  93.          Left            =   2160
  94.          MultiLine       =   -1  'True
  95.          TabIndex        =   1
  96.          Text            =   "Proportional Resizing locks the controls in place at design time"
  97.          Top             =   525
  98.          Width           =   3330
  99.       End
  100.    End
  101. Option Explicit
  102. Dim oh     'original height
  103. Sub Command1_Click ()
  104.   MsgBox "This is done with only one elastic that fills the container and its AutoSizeChildren property set to proportional"
  105. End Sub
  106. Sub Form_Load ()
  107.   oh = vselastic1.Height
  108. End Sub
  109. Sub Form_Resize ()
  110.   'Code to Change fonts when form is resized
  111.   Dim I%
  112.   On Error Resume Next
  113.   If check1.Value Then Exit Sub
  114.   For I = 0 To Controls.Count - 1
  115.     Controls(I).FontSize = 12 * (vselastic1.Height / oh)
  116.     Controls(I).FontName = "Arial"
  117.   Next I
  118.   'oh = vselastic1.Height
  119. End Sub
  120.