home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form fProp
- BackColor = &H00C0C0C0&
- Caption = "Proportional Resizing : Resize the form"
- ClientHeight = 4320
- ClientLeft = 570
- ClientTop = 1590
- ClientWidth = 6000
- Height = 4785
- Left = 480
- LinkTopic = "Form1"
- ScaleHeight = 4320
- ScaleWidth = 6000
- Top = 1215
- Width = 6180
- Begin VideoSoftElastic VSElastic1
- Align = 5 'Fill Container
- AutoSizeChildren= 7 'Proportional
- BackColor = &H00C0C0C0&
- BevelInner = 1 'Raised
- BevelInnerWidth = 0
- BevelOuter = 1 'Raised
- BevelOuterWidth = 1
- Height = 4320
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 6000
- Begin VideoSoftElastic VSElastic2
- AutoSizeChildren= 1 'Even Horizontal
- BackColor = &H00C0C0C0&
- BevelInner = 0 'None
- BevelInnerWidth = 3
- BevelOuter = 0 'None
- BevelOuterWidth = 0
- BorderWidth = 0
- Height = 1500
- Left = 300
- TabIndex = 4
- Top = 570
- Width = 1395
- Begin Image Image1
- Height = 1500
- Left = 0
- Picture = FPROP.FRX:0000
- Stretch = -1 'True
- Top = 0
- Width = 1395
- End
- End
- Begin CheckBox Check1
- BackColor = &H00C0C0C0&
- Caption = "Lock Font Size"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 765
- Left = 2715
- TabIndex = 3
- Top = 3330
- Width = 3210
- End
- Begin CommandButton Command1
- BackColor = &H00C0C0C0&
- Caption = "&Help"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 720
- Left = 255
- TabIndex = 2
- Top = 3285
- Width = 2340
- End
- Begin TextBox Text1
- BackColor = &H00FFFFFF&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 13.5
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FF0000&
- Height = 2220
- Left = 2190
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 1
- Text = "Proportional Resizing locks the controls in place at design time"
- Top = 525
- Width = 3375
- End
- End
- Option Explicit
- Dim oh 'original height
- Sub Command1_Click ()
- MsgBox "This is done with only one elastic that fills the container and its AutoSizeChildren property set to proportional"
- End Sub
- Sub Form_Load ()
- oh = vselastic1.Height
- End Sub
- Sub VSElastic1_ResizeChildren ()
- 'Code to Change fonts when form is resized
- Dim I%
- On Error Resume Next
- If check1.Value Then Exit Sub
- For I = 0 To Controls.Count - 1
- Controls(I).FontSize = Controls(I).FontSize * (vselastic1.Height / oh)
- Controls(I).FontName = "Arial"
- Next I
- oh = vselastic1.Height
- End Sub
-