home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / autoform / autosize.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  3.0 KB  |  103 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   2775
  5.    ClientLeft      =   1710
  6.    ClientTop       =   1935
  7.    ClientWidth     =   4275
  8.    Height          =   3180
  9.    Left            =   1650
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2775
  12.    ScaleWidth      =   4275
  13.    Top             =   1590
  14.    Width           =   4395
  15.    Begin CommandButton Command4 
  16.       Caption         =   "4"
  17.       Height          =   252
  18.       Left            =   1200
  19.       TabIndex        =   6
  20.       Top             =   2475
  21.       Width           =   372
  22.    End
  23.    Begin PictureBox Panel3D3 
  24.       BackColor       =   &H000000FF&
  25.       Height          =   1000
  26.       Left            =   0
  27.       ScaleHeight     =   975
  28.       ScaleWidth      =   975
  29.       TabIndex        =   0
  30.       Top             =   0
  31.       Width           =   1000
  32.    End
  33.    Begin PictureBox Panel3D2 
  34.       BackColor       =   &H000000FF&
  35.       Height          =   1000
  36.       Left            =   0
  37.       ScaleHeight     =   975
  38.       ScaleWidth      =   975
  39.       TabIndex        =   4
  40.       Top             =   0
  41.       Width           =   1000
  42.    End
  43.    Begin CommandButton Command3 
  44.       Caption         =   "3"
  45.       Height          =   252
  46.       Left            =   840
  47.       TabIndex        =   3
  48.       Top             =   2475
  49.       Width           =   372
  50.    End
  51.    Begin CommandButton Command2 
  52.       Caption         =   "2"
  53.       Height          =   252
  54.       Left            =   480
  55.       TabIndex        =   2
  56.       Top             =   2475
  57.       Width           =   372
  58.    End
  59.    Begin CommandButton Command1 
  60.       Caption         =   "1"
  61.       Height          =   252
  62.       Left            =   120
  63.       TabIndex        =   1
  64.       Top             =   2475
  65.       Width           =   372
  66.    End
  67.    Begin PictureBox Panel3D1 
  68.       BackColor       =   &H000000FF&
  69.       Height          =   1000
  70.       Left            =   0
  71.       ScaleHeight     =   975
  72.       ScaleWidth      =   975
  73.       TabIndex        =   5
  74.       Top             =   0
  75.       Width           =   1000
  76.    End
  77. Option Explicit
  78. Sub Form_Resize ()
  79. ' Scale this panel's width according to the size
  80. ' of the form and place it along the bottom of
  81. ' form.
  82. Panel3D1.Width = ScaleWidth - Panel3D1.Left
  83. Panel3D1.Top = ScaleHeight - 372
  84. ' Place this 2 controls along the bottom right of
  85. ' the form when resized.
  86. Panel3D2.Left = ScaleWidth - 2075
  87. Panel3D2.Top = ScaleHeight - 310
  88. Panel3D3.Left = ScaleWidth - 1095
  89. Panel3D3.Top = ScaleHeight - 310
  90. ' Place this 4 controls at bottom left of the
  91. ' form when resized.
  92. Command1.Top = ScaleHeight - 300
  93. Command2.Top = ScaleHeight - 300
  94. Command3.Top = ScaleHeight - 300
  95. Command4.Top = ScaleHeight - 300
  96. ' Place the form center of screen when resized,
  97. ' but this procedure will not execute, if form
  98. ' is minimized or maximized.
  99. If WindowState = 0 Then
  100.    Move (Screen.Width - Form1.Width) / 2, (Screen.Height - Form1.Height) / 2
  101. End If
  102. End Sub
  103.