home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Events - initializtion & painting"
- ClientHeight = 3765
- ClientLeft = 1020
- ClientTop = 1590
- ClientWidth = 4035
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 4170
- Left = 960
- LinkTopic = "Form1"
- ScaleHeight = 3765
- ScaleWidth = 4035
- Top = 1245
- Width = 4155
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 2655
- Left = 300
- ScaleHeight = 2625
- ScaleWidth = 2685
- TabIndex = 0
- Top = 480
- Width = 2715
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- ' This function adjusts the positions of screen elements
- ' for this form
- Private Sub AdjustPositions()
- ' Set the picture control flush with the left side,
- ' keep the current width, but fill the height of the form
- picture1.Move 0, 0, picture1.Width, ScaleHeight
- ' Be sure the picture is large enough
- If ScaleWidth < 3600 Then
- Move Left, Top, 3700, Height
- Exit Sub
- End If
- End Sub
- Private Sub Form_Resize()
- ' 1: Every form gets a resize event when it is
- ' created.
- ' It also gets this event when the form is
- ' resized by the user
- AdjustPositions
- End Sub
- Private Sub Picture1_Paint()
- ' 2 - The Paint event occurs when any part of the window
- ' needs to be updated.
- picture1.Line (0, 0)-(picture1.ScaleWidth, picture1.ScaleHeight)
- End Sub
- Private Sub Picture1_Resize()
- ' 3 - In this case we also need to force an update
- ' any time the size of the picture changes.
- picture1.Refresh
- End Sub
-