home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "3-D4VB Sub Routines"
- ClientHeight = 6645
- ClientLeft = 645
- ClientTop = 375
- ClientWidth = 8550
- Height = 7050
- Left = 585
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 6645
- ScaleWidth = 8550
- Top = 30
- Width = 8670
- Begin PictureBox Picture12
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 495
- Left = 4680
- ScaleHeight = 495
- ScaleWidth = 3495
- TabIndex = 14
- Top = 5640
- Width = 3495
- End
- Begin PictureBox Picture14
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 1095
- Left = 480
- ScaleHeight = 1095
- ScaleWidth = 3375
- TabIndex = 17
- Top = 5040
- Width = 3375
- End
- Begin PictureBox Picture8
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- ForeColor = &H00000000&
- Height = 615
- Left = 4680
- ScaleHeight = 615
- ScaleWidth = 3495
- TabIndex = 8
- Top = 4800
- Width = 3495
- End
- Begin Timer Timer2
- Enabled = 0 'False
- Interval = 2000
- Left = 4080
- Top = 4320
- End
- Begin PictureBox Picture7
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 615
- Left = 480
- ScaleHeight = 615
- ScaleWidth = 3375
- TabIndex = 7
- Top = 3600
- Width = 3375
- End
- Begin PictureBox Picture9
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 1575
- Left = 4680
- ScaleHeight = 1575
- ScaleWidth = 3495
- TabIndex = 9
- Top = 3000
- Width = 3495
- Begin PictureBox MultiBar
- AutoSize = -1 'True
- DrawMode = 6 'Invert
- Height = 360
- Left = 1920
- Picture = FORM1.FRX:0000
- ScaleHeight = 330
- ScaleWidth = 1065
- TabIndex = 15
- TabStop = 0 'False
- Top = 1080
- Width = 1095
- End
- Begin PictureBox SingleBar
- AutoSize = -1 'True
- DrawMode = 6 'Invert
- Height = 360
- Left = 1920
- Picture = FORM1.FRX:0A6A
- ScaleHeight = 330
- ScaleWidth = 1065
- TabIndex = 10
- TabStop = 0 'False
- Top = 480
- Width = 1095
- End
- End
- Begin Timer Timer1
- Enabled = 0 'False
- Interval = 1000
- Left = 4680
- Top = 3000
- End
- Begin PictureBox Picture6
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 615
- Left = 480
- ScaleHeight = 615
- ScaleWidth = 3375
- TabIndex = 6
- Top = 2760
- Width = 3375
- End
- Begin PictureBox Picture13
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 735
- Left = 6480
- ScaleHeight = 735
- ScaleWidth = 1695
- TabIndex = 16
- Top = 2040
- Width = 1695
- End
- Begin PictureBox Picture11
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 735
- Left = 4680
- ScaleHeight = 735
- ScaleWidth = 1575
- TabIndex = 13
- Top = 2040
- Width = 1575
- End
- Begin PictureBox Picture5
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 615
- Left = 480
- ScaleHeight = 615
- ScaleWidth = 3375
- TabIndex = 5
- Top = 1920
- Width = 3375
- End
- Begin PictureBox Picture10
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 735
- Left = 6480
- ScaleHeight = 735
- ScaleWidth = 1695
- TabIndex = 12
- Top = 1080
- Width = 1695
- End
- Begin PictureBox Picture4
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 735
- Left = 4680
- ScaleHeight = 735
- ScaleWidth = 1575
- TabIndex = 4
- Top = 1080
- Width = 1575
- End
- Begin PictureBox Picture1
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 1215
- Left = 480
- ScaleHeight = 1215
- ScaleWidth = 3375
- TabIndex = 0
- Top = 480
- Width = 3375
- Begin TextBox Text2
- BackColor = &H00FFFF00&
- BorderStyle = 0 'None
- ForeColor = &H00FF0000&
- Height = 255
- Left = 120
- TabIndex = 18
- Text = "Text2"
- Top = 840
- Width = 1455
- End
- Begin TextBox Text1
- Height = 375
- Left = 1920
- TabIndex = 1
- Text = "Text1"
- Top = 240
- Width = 1335
- End
- Begin Label Label1
- BorderStyle = 1 'Fixed Single
- Caption = "Label1"
- Height = 375
- Left = 120
- TabIndex = 11
- Top = 240
- Width = 1455
- End
- End
- Begin PictureBox Picture3
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 615
- Left = 6480
- ScaleHeight = 615
- ScaleWidth = 1695
- TabIndex = 3
- Top = 240
- Width = 1695
- End
- Begin PictureBox Picture2
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 615
- Left = 4680
- ScaleHeight = 615
- ScaleWidth = 1575
- TabIndex = 2
- Top = 240
- Width = 1575
- End
- Dim Selected As Integer
- Sub BuildScreen ()
- ' FormFrame
- FormFrame Form1
- ' BorderBox Places Shadowed Border around Text and Label Controls
- ' suggested from code in Nov./Dec.1991 BASICPro Magazine.
- ' Since labels and text boxes have no print method use this routine
- Picture1.AutoRedraw = True
- RaisedBorderBox Text1, Picture1
- BorderBox Label1, Picture1, 2
- BorderBox Text2, Picture1, 1
- LabelBox Label1, Picture1, "BorderBox", 2, 0, GRAY, ETCHED
- Picture1.FontBold = False
- LabelBox Text1, Picture1, "RaisedBorderBox", 2, 0, BLACK, NORMAL
- Picture1.FontBold = True
- LabelBox Text1, Picture1, "LabelBox", 2, 2, BLUE, ETCHED
- Picture1.AutoRedraw = False
- ' EtchedFrames
- ' Picture Boxes that appear like frame controls
- Picture5.AutoRedraw = True
- EtchedFrame Picture5, "Left EtchedFrame", 0, RED, ETCHED
- Picture5.AutoRedraw = False
- Picture6.AutoRedraw = True
- EtchedFrame Picture6, "Right EtchedFrame", 1, BLUE, NORMAL
- Picture6.AutoRedraw = False
- Picture7.AutoRedraw = True
- EtchedFrame Picture7, "Centered EtchedFrame", 2, GREEN, RAISED
- Picture7.AutoRedraw = False
- ' PicFrame Picture Border
- Picture2.AutoRedraw = True
- PicFrame Picture2
- ' LabelBox Places "etched" or normal text inside picture controls
- LabelInBox Picture2, "PicFrame", 2, 1, RED, ETCHED
- Picture2.AutoRedraw = False
- ' EtchedPicBorder
- Picture3.AutoRedraw = True
- EtchedPicBorder Picture3
- LabelInBox Picture3, "EtchedPicBorder", 2, 1, CYAN, NORMAL
- Picture3.AutoRedraw = False
- ' RaisedPicBorder
- Picture4.AutoRedraw = True
- RaisedPicBorder Picture4, 2
- LabelInBox Picture4, "RaisedPicBorder", 2, 1, GREEN, NORMAL
- LabelInBox Picture4, "Click ME!", 2, 0, BLACK, NORMAL
- Picture4.AutoRedraw = False
- ' ShadowPicBorder
- Picture10.AutoRedraw = True
- ShadowPicBorder Picture10, 1
- LabelInBox Picture10, "ShadowPicBorder", 2, 1, BLACK, ETCHED
- Picture10.AutoRedraw = False
- ' RaisedPicEdge
- Picture11.AutoRedraw = True
- RaisedPicEdge Picture11
- Picture11.FontBold = False
- LabelInBox Picture11, "RaisedPicEdge", 2, 1, MAGENTA, NORMAL
- LabelInBox Picture11, "Click ME!", 2, 0, BLACK, NORMAL
- Picture11.AutoRedraw = False
- ' ShadoPicFrame
- Picture13.AutoRedraw = True
- ShadowPicFrame Picture13, 1
- LabelInBox Picture13, "ShadowPicFrame", 2, 1, BLUE, ETCHED
- Picture13.AutoRedraw = False
- Picture8.AutoRedraw = True
- RaisedPicEdge Picture8
- ' EtchedPicText
- ' Prints "etched" text on control capable of accepting .print method
- EtchedPicText Picture8, "This is EtchedPicText", 10, 10, BLUE
- ' RaisedPicText
- RaisedPicText Picture8, "This is RaisedPicText", 10, Picture8.TextHeight("I") + 60, BLUE
- Picture8.AutoRedraw = False
- ' EtchedFrmText
- ' Prints "etched" text on form background
- Form1.AutoRedraw = True
- EtchedFrmText Form1, "This is EtchedFrmText", 1200, 120, BLUE
- RaisedFrmText Form1, "NO DLL, ALL VB SOURCE CODE PROVIDED!", 120, Form1.ScaleHeight - Form1.TextHeight("I") - 120, BLACK
- EtchedFrmText Form1, "FormFrame", 120, 120, RED
- ' RaisedFrmText
- OldFS = Form1.FontSize
- Form1.FontSize = 16
- RaisedFrmText Form1, "3-D Effects", Form1.ScaleWidth * .75, Form1.ScaleHeight - (Form1.TextHeight("I") + 120), BLUE
- Form1.FontSize = OldFS
- ' EtchedFrmLine
- ' works like the .Line method but creates etched look
- EtchedFrmLine Form1, Form1.ScaleWidth / 2, 240, Form1.ScaleWidth / 2, Form1.ScaleHeight - 240
- EtchedFrmLine Form1, 240, Form1.ScaleHeight * .7, Form1.ScaleWidth / 2 - 240, Form1.ScaleHeight * .7
- EtchedFrmText Form1, "EtchedFrmLine", 240, Form1.ScaleHeight * .7 - Form1.TextHeight("I"), MAGENTA
- Form1.AutoRedraw = False
- Picture12.AutoRedraw = True
- ShadowPicFrame Picture12, 2
- LabelInBox Picture12, "EXIT", 2, 1, RED, ETCHED
- Picture12.AutoRedraw = False
- Picture14.AutoRedraw = True
- EtchedPicBorder Picture14
- LabelInBox Picture14, "LabelInBox", 2, 1, MAGENTA, RAISED
- LabelInBox Picture14, "LeftTop", 0, 0, RED, RAISED
- LabelInBox Picture14, "LeftMiddle", 0, 1, WHITE, NORMAL
- LabelInBox Picture14, "LeftBottom", 0, 2, BLUE, False
- LabelInBox Picture14, "CntrTop", 2, 0, CYAN, NORMAL
- LabelInBox Picture14, "CntrBottom", 2, 2, GRAY, ETCHED
- LabelInBox Picture14, "TRight", 1, 0, BLUE, RAISED
- LabelInBox Picture14, "MRight", 1, 1, WHITE, NORMAL
- LabelInBox Picture14, "BRight", 1, 2, RED, ETCHED
- Picture14.AutoRedraw = False
- ' Example of Selection "Buttons" made from simple Picture controls
- ' Examine SingleBar_MouseDown() and MultiBar_MouseDown() routines
- ' Be sure to define picture box with AutoSize = TRUE and DrawMode = INVERT
- Picture9.AutoRedraw = True
- EtchedFrame Picture9, "Picture Buttons", 0, BLACK, True
- BorderBox SingleBar, Picture9, 2
- BorderBox MultiBar, Picture9, 2
- LabelBox SingleBar, Picture9, "Single Option", 0, 1, BLUE, ETCHED
- LabelBox MultiBar, Picture9, "Multiple Options", 0, 1, BLUE, ETCHED
- Picture9.AutoRedraw = False
- End Sub
- Sub Form_Load ()
- Form1.Left = (Screen.Width - Form1.Width) / 2
- Form1.Top = (Screen.Height - Form1.Height) / 2
- BuildScreen
- Unload Form3
- Form1.Show
- Timer2.Enabled = True
- Screen.MousePointer = 0
- End Sub
- Sub MultiBar_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- MultiBar.AutoRedraw = True
- Zone = MultiBar.ScaleWidth / 3 'number of icons
- Select Case X
- Case 0 To Zone
- MultiBar.Line (0, 0)-(Zone - 2, ScaleHeight), , BF
- ' DO Action
- Case Zone + 1 To Zone * 2
- MultiBar.Line (Zone + 1, 0)-(Zone * 2 - 2, ScaleHeight), , BF
- ' Do Action
- Case 2 * Zone + 1 To Zone * 3
- MultiBar.Line (Zone * 2 + 1, 0)-(Zone * 3 - 2, ScaleHeight), , BF
- ' Do Action
- End Select
- Text$ = "Some Action..."
- Picture9.ForeColor = RED
- Picture9.Currentx = MultiBar.Left
- Picture9.Currenty = MultiBar.Top - (Picture9.TextHeight("I") + 30)
- Picture9.Print Text$
- Timer1.Enabled = True
- MultiBar.AutoRedraw = False
- End Sub ' MultiBar_MouseDown()
- Sub Picture11_Click ()
- Action = 11
- Form2.Show
- End Sub ' Picture11_Click()
- Sub Picture11_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicPaint Picture11
- End Sub ' Picture11_MouseDown()
- Sub Picture11_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicPaint Picture11
- End Sub ' Picture11_MouseUp()
- Sub Picture12_Click ()
- End Sub
- Sub Picture12_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicFramedPaint Picture12
- End Sub
- Sub Picture12_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicFramedPaint Picture12
- End Sub
- Sub Picture3_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicPaint Picture3
- End Sub
- Sub Picture3_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicPaint Picture3
- End Sub
- Sub Picture4_Click ()
- Action = 4
- Form2.Show
- End Sub
- Sub Picture4_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicPaint Picture4
- End Sub
- Sub Picture4_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- PicPaint Picture4
- End Sub
- Sub SingleBar_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- SingleBar.AutoRedraw = True
- Zone = SingleBar.ScaleWidth / 3 'number of icons
- LastSelected = Selected
- Select Case X
- Case 0 To Zone
- SingleBar.Line (0, 0)-(Zone - 2, ScaleHeight), , BF
- Selected = 1
- ' DO Action
- Case Zone + 1 To Zone * 2
- SingleBar.Line (Zone + 1, 0)-(Zone * 2 - 2, ScaleHeight), , BF
- Selected = 2
- ' Do Action
- Case 2 * Zone + 1 To Zone * 3
- SingleBar.Line (Zone * 2 + 1, 0)-(Zone * 3 - 2, ScaleHeight), , BF
- Selected = 3
- ' Do Action
- End Select
- Select Case LastSelected
- Case Is = 1
- SingleBar.Line (0, 0)-(Zone - 2, ScaleHeight), , BF
- Case Is = 2
- SingleBar.Line (Zone + 1, 0)-(Zone * 2 - 2, ScaleHeight), , BF
- Case Is = 3
- SingleBar.Line (Zone * 2 + 1, 0)-(Zone * 3 - 2, ScaleHeight), , BF
- End Select
- Text$ = "Some Action..."
- Picture9.ForeColor = RED
- Picture9.Currentx = SingleBar.Left
- Picture9.Currenty = SingleBar.Top - (Picture9.TextHeight("I") + 30)
- Picture9.Print Text$
- Timer1.Enabled = True
- SingleBar.AutoRedraw = False
- End Sub
- Sub Text1_GotFocus ()
- HighlightEntry Text1
- End Sub
- Sub Text2_GotFocus ()
- HighlightEntry Text2
- End Sub
- Sub Timer1_Timer ()
- Timer1.Enabled = False
- Picture9.Cls
- End Sub
- Sub Timer2_Timer ()
- Timer2.Enabled = False
- ' Set initial value for Singe Mode button bar
- SingleBar.AutoRedraw = True
- Zone = SingleBar.ScaleWidth / 3 'number of icons
- SingleBar.Line (0, 0)-(Zone - 2, SingleBar.ScaleHeight), , BF
- Selected = 1
- SingleBar.AutoRedraw = False
- End Sub
-