home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmQuadTest
- Caption = "Quadrants ModuleTester"
- ClientHeight = 6165
- ClientLeft = 1140
- ClientTop = 1515
- ClientWidth = 7950
- Height = 6570
- Left = 1080
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 6165
- ScaleWidth = 7950
- Tag = "Quadrants ModuleTester"
- Top = 1170
- Width = 8070
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 750
- Left = 840
- ScaleHeight = 720
- ScaleWidth = 2295
- TabIndex = 0
- Top = 735
- Width = 2325
- End
- Attribute VB_Name = "frmQuadTest"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Click()
- If Caption = "Click Me!" Then
- MsgBox "Buttons? We don't need no stinking buttons!.", vbInformation
- End If
- End Sub
- Private Sub Form_Load()
- Dim r As RECT
- AutoRedraw = True
- Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
- ' Create a 3D grid with four quadrants on the form.
- Draw3DGrid Me, True
- ' Create PictureBox button
- With Picture1
- GetQuad 1, r
- SizeToRectClient Picture1, r
- .AutoRedraw = True
- .ScaleMode = vbPixels
- .BackColor = BackColor
- .BorderStyle = 0
- Draw3DPicBorder Picture1, False
- End With
- ' Draw a purple rectangle in the second quadrant.
- GetQuad 2, r
- ResizeRect r, -2, -2, False
- DrawRect Me, r, True, RGB(64, 0, 128)
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim r As RECT
- If Caption = "Click Me!" Then
- GetQuad 2, r
- ResizeRect r, -2, -2, False
- DrawMode = 6
- DrawRect Me, r, True, Point(X, Y)
- DrawMode = 13
- End If
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim pt As PointAPI, r As RECT
- pt.X = X
- pt.Y = Y
- GetQuad 2, r
- #If Win32 Then
- Caption = IIf(PtInRect(r, pt.X, pt.Y), "Click Me!", Tag)
- #Else
- Caption = IIf(PtInRect(r, pt.Y, pt.X), "Click Me!", Tag)
- #End If
- End Sub
- Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim r As RECT
- GetQuad 2, r
- ResizeRect r, -2, -2, False
- DrawRect Me, r, True, RGB(64, 0, 128)
- End Sub
- Private Sub Picture1_Click()
- MsgBox "Click events only occur when the MouseUp event occurs over the control.", vbInformation
- End Sub
- Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Draw3DPicBorder Picture1, True
- End Sub
- Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Draw3DPicBorder Picture1, False
- End Sub
-