home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / 3d_vb / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  16.1 KB  |  471 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "3-D4VB Sub Routines"
  6.    ClientHeight    =   6645
  7.    ClientLeft      =   645
  8.    ClientTop       =   375
  9.    ClientWidth     =   8550
  10.    Height          =   7050
  11.    Left            =   585
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   6645
  15.    ScaleWidth      =   8550
  16.    Top             =   30
  17.    Width           =   8670
  18.    Begin PictureBox Picture12 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   495
  22.       Left            =   4680
  23.       ScaleHeight     =   495
  24.       ScaleWidth      =   3495
  25.       TabIndex        =   14
  26.       Top             =   5640
  27.       Width           =   3495
  28.    End
  29.    Begin PictureBox Picture14 
  30.       BackColor       =   &H00C0C0C0&
  31.       BorderStyle     =   0  'None
  32.       Height          =   1095
  33.       Left            =   480
  34.       ScaleHeight     =   1095
  35.       ScaleWidth      =   3375
  36.       TabIndex        =   17
  37.       Top             =   5040
  38.       Width           =   3375
  39.    End
  40.    Begin PictureBox Picture8 
  41.       BackColor       =   &H00C0C0C0&
  42.       BorderStyle     =   0  'None
  43.       ForeColor       =   &H00000000&
  44.       Height          =   615
  45.       Left            =   4680
  46.       ScaleHeight     =   615
  47.       ScaleWidth      =   3495
  48.       TabIndex        =   8
  49.       Top             =   4800
  50.       Width           =   3495
  51.    End
  52.    Begin Timer Timer2 
  53.       Enabled         =   0   'False
  54.       Interval        =   2000
  55.       Left            =   4080
  56.       Top             =   4320
  57.    End
  58.    Begin PictureBox Picture7 
  59.       BackColor       =   &H00C0C0C0&
  60.       BorderStyle     =   0  'None
  61.       Height          =   615
  62.       Left            =   480
  63.       ScaleHeight     =   615
  64.       ScaleWidth      =   3375
  65.       TabIndex        =   7
  66.       Top             =   3600
  67.       Width           =   3375
  68.    End
  69.    Begin PictureBox Picture9 
  70.       BackColor       =   &H00C0C0C0&
  71.       BorderStyle     =   0  'None
  72.       Height          =   1575
  73.       Left            =   4680
  74.       ScaleHeight     =   1575
  75.       ScaleWidth      =   3495
  76.       TabIndex        =   9
  77.       Top             =   3000
  78.       Width           =   3495
  79.       Begin PictureBox MultiBar 
  80.          AutoSize        =   -1  'True
  81.          DrawMode        =   6  'Invert
  82.          Height          =   360
  83.          Left            =   1920
  84.          Picture         =   FORM1.FRX:0000
  85.          ScaleHeight     =   330
  86.          ScaleWidth      =   1065
  87.          TabIndex        =   15
  88.          TabStop         =   0   'False
  89.          Top             =   1080
  90.          Width           =   1095
  91.       End
  92.       Begin PictureBox SingleBar 
  93.          AutoSize        =   -1  'True
  94.          DrawMode        =   6  'Invert
  95.          Height          =   360
  96.          Left            =   1920
  97.          Picture         =   FORM1.FRX:0A6A
  98.          ScaleHeight     =   330
  99.          ScaleWidth      =   1065
  100.          TabIndex        =   10
  101.          TabStop         =   0   'False
  102.          Top             =   480
  103.          Width           =   1095
  104.       End
  105.    End
  106.    Begin Timer Timer1 
  107.       Enabled         =   0   'False
  108.       Interval        =   1000
  109.       Left            =   4680
  110.       Top             =   3000
  111.    End
  112.    Begin PictureBox Picture6 
  113.       BackColor       =   &H00C0C0C0&
  114.       BorderStyle     =   0  'None
  115.       Height          =   615
  116.       Left            =   480
  117.       ScaleHeight     =   615
  118.       ScaleWidth      =   3375
  119.       TabIndex        =   6
  120.       Top             =   2760
  121.       Width           =   3375
  122.    End
  123.    Begin PictureBox Picture13 
  124.       BackColor       =   &H00C0C0C0&
  125.       BorderStyle     =   0  'None
  126.       Height          =   735
  127.       Left            =   6480
  128.       ScaleHeight     =   735
  129.       ScaleWidth      =   1695
  130.       TabIndex        =   16
  131.       Top             =   2040
  132.       Width           =   1695
  133.    End
  134.    Begin PictureBox Picture11 
  135.       BackColor       =   &H00C0C0C0&
  136.       BorderStyle     =   0  'None
  137.       Height          =   735
  138.       Left            =   4680
  139.       ScaleHeight     =   735
  140.       ScaleWidth      =   1575
  141.       TabIndex        =   13
  142.       Top             =   2040
  143.       Width           =   1575
  144.    End
  145.    Begin PictureBox Picture5 
  146.       BackColor       =   &H00C0C0C0&
  147.       BorderStyle     =   0  'None
  148.       Height          =   615
  149.       Left            =   480
  150.       ScaleHeight     =   615
  151.       ScaleWidth      =   3375
  152.       TabIndex        =   5
  153.       Top             =   1920
  154.       Width           =   3375
  155.    End
  156.    Begin PictureBox Picture10 
  157.       BackColor       =   &H00C0C0C0&
  158.       BorderStyle     =   0  'None
  159.       Height          =   735
  160.       Left            =   6480
  161.       ScaleHeight     =   735
  162.       ScaleWidth      =   1695
  163.       TabIndex        =   12
  164.       Top             =   1080
  165.       Width           =   1695
  166.    End
  167.    Begin PictureBox Picture4 
  168.       BackColor       =   &H00C0C0C0&
  169.       BorderStyle     =   0  'None
  170.       Height          =   735
  171.       Left            =   4680
  172.       ScaleHeight     =   735
  173.       ScaleWidth      =   1575
  174.       TabIndex        =   4
  175.       Top             =   1080
  176.       Width           =   1575
  177.    End
  178.    Begin PictureBox Picture1 
  179.       BackColor       =   &H00C0C0C0&
  180.       BorderStyle     =   0  'None
  181.       Height          =   1215
  182.       Left            =   480
  183.       ScaleHeight     =   1215
  184.       ScaleWidth      =   3375
  185.       TabIndex        =   0
  186.       Top             =   480
  187.       Width           =   3375
  188.       Begin TextBox Text2 
  189.          BackColor       =   &H00FFFF00&
  190.          BorderStyle     =   0  'None
  191.          ForeColor       =   &H00FF0000&
  192.          Height          =   255
  193.          Left            =   120
  194.          TabIndex        =   18
  195.          Text            =   "Text2"
  196.          Top             =   840
  197.          Width           =   1455
  198.       End
  199.       Begin TextBox Text1 
  200.          Height          =   375
  201.          Left            =   1920
  202.          TabIndex        =   1
  203.          Text            =   "Text1"
  204.          Top             =   240
  205.          Width           =   1335
  206.       End
  207.       Begin Label Label1 
  208.          BorderStyle     =   1  'Fixed Single
  209.          Caption         =   "Label1"
  210.          Height          =   375
  211.          Left            =   120
  212.          TabIndex        =   11
  213.          Top             =   240
  214.          Width           =   1455
  215.       End
  216.    End
  217.    Begin PictureBox Picture3 
  218.       BackColor       =   &H00C0C0C0&
  219.       BorderStyle     =   0  'None
  220.       Height          =   615
  221.       Left            =   6480
  222.       ScaleHeight     =   615
  223.       ScaleWidth      =   1695
  224.       TabIndex        =   3
  225.       Top             =   240
  226.       Width           =   1695
  227.    End
  228.    Begin PictureBox Picture2 
  229.       BackColor       =   &H00C0C0C0&
  230.       BorderStyle     =   0  'None
  231.       Height          =   615
  232.       Left            =   4680
  233.       ScaleHeight     =   615
  234.       ScaleWidth      =   1575
  235.       TabIndex        =   2
  236.       Top             =   240
  237.       Width           =   1575
  238.    End
  239. Dim Selected As Integer
  240. Sub BuildScreen ()
  241.   ' FormFrame
  242.   FormFrame Form1
  243.   ' BorderBox Places Shadowed Border around Text and Label Controls
  244.   ' suggested from code in Nov./Dec.1991 BASICPro Magazine.
  245.   ' Since labels and text boxes have no print method use this routine
  246.   Picture1.AutoRedraw = True
  247.   RaisedBorderBox Text1, Picture1
  248.   BorderBox Label1, Picture1, 2
  249.   BorderBox Text2, Picture1, 1
  250.   LabelBox Label1, Picture1, "BorderBox", 2, 0, GRAY, ETCHED
  251.   Picture1.FontBold = False
  252.   LabelBox Text1, Picture1, "RaisedBorderBox", 2, 0, BLACK, NORMAL
  253.   Picture1.FontBold = True
  254.   LabelBox Text1, Picture1, "LabelBox", 2, 2, BLUE, ETCHED
  255.   Picture1.AutoRedraw = False
  256.   ' EtchedFrames
  257.   ' Picture Boxes that appear like frame controls
  258.   Picture5.AutoRedraw = True
  259.   EtchedFrame Picture5, "Left EtchedFrame", 0, RED, ETCHED
  260.   Picture5.AutoRedraw = False
  261.   Picture6.AutoRedraw = True
  262.   EtchedFrame Picture6, "Right EtchedFrame", 1, BLUE, NORMAL
  263.   Picture6.AutoRedraw = False
  264.   Picture7.AutoRedraw = True
  265.   EtchedFrame Picture7, "Centered EtchedFrame", 2, GREEN, RAISED
  266.   Picture7.AutoRedraw = False
  267.   ' PicFrame Picture Border
  268.   Picture2.AutoRedraw = True
  269.   PicFrame Picture2
  270.   ' LabelBox Places "etched" or normal text inside picture controls
  271.   LabelInBox Picture2, "PicFrame", 2, 1, RED, ETCHED
  272.   Picture2.AutoRedraw = False
  273.   ' EtchedPicBorder
  274.   Picture3.AutoRedraw = True
  275.   EtchedPicBorder Picture3
  276.   LabelInBox Picture3, "EtchedPicBorder", 2, 1, CYAN, NORMAL
  277.   Picture3.AutoRedraw = False
  278.   ' RaisedPicBorder
  279.   Picture4.AutoRedraw = True
  280.   RaisedPicBorder Picture4, 2
  281.   LabelInBox Picture4, "RaisedPicBorder", 2, 1, GREEN, NORMAL
  282.   LabelInBox Picture4, "Click ME!", 2, 0, BLACK, NORMAL
  283.   Picture4.AutoRedraw = False
  284.   ' ShadowPicBorder
  285.   Picture10.AutoRedraw = True
  286.   ShadowPicBorder Picture10, 1
  287.   LabelInBox Picture10, "ShadowPicBorder", 2, 1, BLACK, ETCHED
  288.   Picture10.AutoRedraw = False
  289.   ' RaisedPicEdge
  290.   Picture11.AutoRedraw = True
  291.   RaisedPicEdge Picture11
  292.   Picture11.FontBold = False
  293.   LabelInBox Picture11, "RaisedPicEdge", 2, 1, MAGENTA, NORMAL
  294.   LabelInBox Picture11, "Click ME!", 2, 0, BLACK, NORMAL
  295.   Picture11.AutoRedraw = False
  296.   ' ShadoPicFrame
  297.   Picture13.AutoRedraw = True
  298.   ShadowPicFrame Picture13, 1
  299.   LabelInBox Picture13, "ShadowPicFrame", 2, 1, BLUE, ETCHED
  300.   Picture13.AutoRedraw = False
  301.   Picture8.AutoRedraw = True
  302.   RaisedPicEdge Picture8
  303.   ' EtchedPicText
  304.   ' Prints "etched" text on control capable of accepting .print method
  305.   EtchedPicText Picture8, "This is EtchedPicText", 10, 10, BLUE
  306.   ' RaisedPicText
  307.   RaisedPicText Picture8, "This is RaisedPicText", 10, Picture8.TextHeight("I") + 60, BLUE
  308.   Picture8.AutoRedraw = False
  309.   ' EtchedFrmText
  310.   ' Prints "etched" text on form background
  311.   Form1.AutoRedraw = True
  312.   EtchedFrmText Form1, "This is EtchedFrmText", 1200, 120, BLUE
  313.   RaisedFrmText Form1, "NO DLL, ALL VB SOURCE CODE PROVIDED!", 120, Form1.ScaleHeight - Form1.TextHeight("I") - 120, BLACK
  314.   EtchedFrmText Form1, "FormFrame", 120, 120, RED
  315.   ' RaisedFrmText
  316.   OldFS = Form1.FontSize
  317.   Form1.FontSize = 16
  318.   RaisedFrmText Form1, "3-D Effects", Form1.ScaleWidth * .75, Form1.ScaleHeight - (Form1.TextHeight("I") + 120), BLUE
  319.   Form1.FontSize = OldFS
  320.   ' EtchedFrmLine
  321.   ' works like the .Line method but creates etched look
  322.   EtchedFrmLine Form1, Form1.ScaleWidth / 2, 240, Form1.ScaleWidth / 2, Form1.ScaleHeight - 240
  323.   EtchedFrmLine Form1, 240, Form1.ScaleHeight * .7, Form1.ScaleWidth / 2 - 240, Form1.ScaleHeight * .7
  324.   EtchedFrmText Form1, "EtchedFrmLine", 240, Form1.ScaleHeight * .7 - Form1.TextHeight("I"), MAGENTA
  325.   Form1.AutoRedraw = False
  326.   Picture12.AutoRedraw = True
  327.   ShadowPicFrame Picture12, 2
  328.   LabelInBox Picture12, "EXIT", 2, 1, RED, ETCHED
  329.   Picture12.AutoRedraw = False
  330.   Picture14.AutoRedraw = True
  331.   EtchedPicBorder Picture14
  332.   LabelInBox Picture14, "LabelInBox", 2, 1, MAGENTA, RAISED
  333.   LabelInBox Picture14, "LeftTop", 0, 0, RED, RAISED
  334.   LabelInBox Picture14, "LeftMiddle", 0, 1, WHITE, NORMAL
  335.   LabelInBox Picture14, "LeftBottom", 0, 2, BLUE, False
  336.   LabelInBox Picture14, "CntrTop", 2, 0, CYAN, NORMAL
  337.   LabelInBox Picture14, "CntrBottom", 2, 2, GRAY, ETCHED
  338.   LabelInBox Picture14, "TRight", 1, 0, BLUE, RAISED
  339.   LabelInBox Picture14, "MRight", 1, 1, WHITE, NORMAL
  340.   LabelInBox Picture14, "BRight", 1, 2, RED, ETCHED
  341.   Picture14.AutoRedraw = False
  342.   ' Example of Selection "Buttons" made from simple Picture controls
  343.   ' Examine SingleBar_MouseDown() and MultiBar_MouseDown() routines
  344.   ' Be sure to define picture box with AutoSize = TRUE and DrawMode = INVERT
  345.   Picture9.AutoRedraw = True
  346.   EtchedFrame Picture9, "Picture Buttons", 0, BLACK, True
  347.   BorderBox SingleBar, Picture9, 2
  348.   BorderBox MultiBar, Picture9, 2
  349.   LabelBox SingleBar, Picture9, "Single Option", 0, 1, BLUE, ETCHED
  350.   LabelBox MultiBar, Picture9, "Multiple Options", 0, 1, BLUE, ETCHED
  351.   Picture9.AutoRedraw = False
  352. End Sub
  353. Sub Form_Load ()
  354. Form1.Left = (Screen.Width - Form1.Width) / 2
  355. Form1.Top = (Screen.Height - Form1.Height) / 2
  356. BuildScreen
  357. Unload Form3
  358. Form1.Show
  359. Timer2.Enabled = True
  360. Screen.MousePointer = 0
  361. End Sub
  362. Sub MultiBar_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  363.     MultiBar.AutoRedraw = True
  364.     Zone = MultiBar.ScaleWidth / 3    'number of icons
  365.     Select Case X
  366.     Case 0 To Zone
  367.         MultiBar.Line (0, 0)-(Zone - 2, ScaleHeight), , BF
  368.         ' DO Action
  369.     Case Zone + 1 To Zone * 2
  370.         MultiBar.Line (Zone + 1, 0)-(Zone * 2 - 2, ScaleHeight), , BF
  371.         ' Do Action
  372.     Case 2 * Zone + 1 To Zone * 3
  373.         MultiBar.Line (Zone * 2 + 1, 0)-(Zone * 3 - 2, ScaleHeight), , BF
  374.         ' Do Action
  375.     End Select
  376.     Text$ = "Some Action..."
  377.     Picture9.ForeColor = RED
  378.     Picture9.Currentx = MultiBar.Left
  379.     Picture9.Currenty = MultiBar.Top - (Picture9.TextHeight("I") + 30)
  380.     Picture9.Print Text$
  381.     Timer1.Enabled = True
  382.     MultiBar.AutoRedraw = False
  383. End Sub     ' MultiBar_MouseDown()
  384. Sub Picture11_Click ()
  385.     Action = 11
  386.     Form2.Show
  387. End Sub     ' Picture11_Click()
  388. Sub Picture11_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  389.     PicPaint Picture11
  390. End Sub     ' Picture11_MouseDown()
  391. Sub Picture11_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  392.     PicPaint Picture11
  393. End Sub     ' Picture11_MouseUp()
  394. Sub Picture12_Click ()
  395. End Sub
  396. Sub Picture12_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  397.     PicFramedPaint Picture12
  398. End Sub
  399. Sub Picture12_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  400.     PicFramedPaint Picture12
  401. End Sub
  402. Sub Picture3_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  403.     PicPaint Picture3
  404. End Sub
  405. Sub Picture3_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  406.     PicPaint Picture3
  407. End Sub
  408. Sub Picture4_Click ()
  409. Action = 4
  410. Form2.Show
  411. End Sub
  412. Sub Picture4_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  413.     PicPaint Picture4
  414. End Sub
  415. Sub Picture4_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  416.     PicPaint Picture4
  417. End Sub
  418. Sub SingleBar_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  419.     SingleBar.AutoRedraw = True
  420.     Zone = SingleBar.ScaleWidth / 3    'number of icons
  421.     LastSelected = Selected
  422.     Select Case X
  423.     Case 0 To Zone
  424.         SingleBar.Line (0, 0)-(Zone - 2, ScaleHeight), , BF
  425.         Selected = 1
  426.         ' DO Action
  427.     Case Zone + 1 To Zone * 2
  428.         SingleBar.Line (Zone + 1, 0)-(Zone * 2 - 2, ScaleHeight), , BF
  429.         Selected = 2
  430.         ' Do Action
  431.     Case 2 * Zone + 1 To Zone * 3
  432.         SingleBar.Line (Zone * 2 + 1, 0)-(Zone * 3 - 2, ScaleHeight), , BF
  433.         Selected = 3
  434.         ' Do Action
  435.     End Select
  436.     Select Case LastSelected
  437.     Case Is = 1
  438.         SingleBar.Line (0, 0)-(Zone - 2, ScaleHeight), , BF
  439.     Case Is = 2
  440.         SingleBar.Line (Zone + 1, 0)-(Zone * 2 - 2, ScaleHeight), , BF
  441.     Case Is = 3
  442.         SingleBar.Line (Zone * 2 + 1, 0)-(Zone * 3 - 2, ScaleHeight), , BF
  443.     End Select
  444. Text$ = "Some Action..."
  445. Picture9.ForeColor = RED
  446. Picture9.Currentx = SingleBar.Left
  447. Picture9.Currenty = SingleBar.Top - (Picture9.TextHeight("I") + 30)
  448. Picture9.Print Text$
  449. Timer1.Enabled = True
  450. SingleBar.AutoRedraw = False
  451. End Sub
  452. Sub Text1_GotFocus ()
  453.     HighlightEntry Text1
  454. End Sub
  455. Sub Text2_GotFocus ()
  456.     HighlightEntry Text2
  457. End Sub
  458. Sub Timer1_Timer ()
  459. Timer1.Enabled = False
  460. Picture9.Cls
  461. End Sub
  462. Sub Timer2_Timer ()
  463.   Timer2.Enabled = False
  464.   ' Set initial value for Singe Mode button bar
  465.   SingleBar.AutoRedraw = True
  466.   Zone = SingleBar.ScaleWidth / 3    'number of icons
  467.   SingleBar.Line (0, 0)-(Zone - 2, SingleBar.ScaleHeight), , BF
  468.   Selected = 1
  469.   SingleBar.AutoRedraw = False
  470. End Sub
  471.