home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BorderStyle = 3 'Fixed Double
- Caption = "Form Resizing Demonstration"
- ClientHeight = 3045
- ClientLeft = 2805
- ClientTop = 2205
- ClientWidth = 3900
- Height = 3450
- Left = 2745
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3045
- ScaleWidth = 3900
- Top = 1860
- Width = 4020
- Begin CommandButton Command2
- Caption = "End"
- Height = 495
- Left = 1440
- TabIndex = 1
- Top = 2160
- Width = 1215
- End
- Begin CommandButton Command1
- Caption = "Enlarge Form"
- Height = 855
- Left = 1080
- TabIndex = 0
- Top = 600
- Width = 1935
- End
- Option Explicit
- Sub CenterControls ()
- 'Keep the 2 controls centered on the screen.
- command1.Move (form1.Width - command1.Width) / 2, .2 * form1.Height
- command2.Move (form1.Width - command2.Width) / 2, .6 * form1.Height
- End Sub
- Sub CenterForm ()
- 'Center the form on the screen
- form1.Move (screen.Width - form1.Width) / 2, (screen.Height - form1.Height) / 2
- End Sub
- Sub Command1_Click ()
- form1.Width = form1.Width + 200
- form1.Height = form1.Height + 200
- CenterForm
- CenterControls
- End Sub
- Sub Command2_Click ()
- End
- End Sub
- Sub Form_Load ()
- form1.Height = .5 * screen.Height
- form1.Width = .5 * screen.Width
- CenterForm
- CenterControls
- End Sub
-