home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l407 / 1.ddi / BLANKER.FR_ / BLANKER.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  22.1 KB  |  694 lines

  1. VERSION 2.00
  2. Begin Form DemoForm 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "Screen Blanker Demo"
  5.    ClientHeight    =   4425
  6.    ClientLeft      =   960
  7.    ClientTop       =   1965
  8.    ClientWidth     =   7470
  9.    ForeColor       =   &H00000000&
  10.    Height          =   5115
  11.    Icon            =   BLANKER.FRX:0000
  12.    Left            =   900
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form1"
  15.    Picture         =   BLANKER.FRX:0302
  16.    ScaleHeight     =   4425
  17.    ScaleWidth      =   7470
  18.    Top             =   1335
  19.    Width           =   7590
  20.    Begin Timer Timer1 
  21.       Interval        =   1
  22.       Left            =   6960
  23.       Top             =   120
  24.    End
  25.    Begin CommandButton cmdStartStop 
  26.       BackColor       =   &H00000000&
  27.       Caption         =   "Start Demo"
  28.       Default         =   -1  'True
  29.       Height          =   390
  30.       Left            =   240
  31.       TabIndex        =   0
  32.       Top             =   120
  33.       Width           =   1830
  34.    End
  35.    Begin PictureBox picBall 
  36.       AutoSize        =   -1  'True
  37.       BackColor       =   &H00000000&
  38.       BorderStyle     =   0  'None
  39.       ForeColor       =   &H00FFFFFF&
  40.       Height          =   600
  41.       Left            =   1800
  42.       Picture         =   BLANKER.FRX:0740
  43.       ScaleHeight     =   480
  44.       ScaleWidth      =   480
  45.       TabIndex        =   1
  46.       Top             =   720
  47.       Visible         =   0   'False
  48.       Width           =   600
  49.    End
  50.    Begin Image imgMoon 
  51.       Height          =   480
  52.       Index           =   8
  53.       Left            =   6330
  54.       Picture         =   BLANKER.FRX:0A42
  55.       Top             =   3765
  56.       Visible         =   0   'False
  57.       Width           =   480
  58.    End
  59.    Begin Line linLineCtl 
  60.       BorderColor     =   &H00FF0000&
  61.       BorderWidth     =   5
  62.       Visible         =   0   'False
  63.       X1              =   240
  64.       X2              =   4080
  65.       Y1              =   2760
  66.       Y2              =   2760
  67.    End
  68.    Begin Image imgMoon 
  69.       Height          =   480
  70.       Index           =   7
  71.       Left            =   5760
  72.       Picture         =   BLANKER.FRX:0D44
  73.       Top             =   3720
  74.       Visible         =   0   'False
  75.       Width           =   480
  76.    End
  77.    Begin Image imgMoon 
  78.       Height          =   480
  79.       Index           =   6
  80.       Left            =   5160
  81.       Picture         =   BLANKER.FRX:1046
  82.       Top             =   3720
  83.       Visible         =   0   'False
  84.       Width           =   480
  85.    End
  86.    Begin Image imgMoon 
  87.       Height          =   480
  88.       Index           =   5
  89.       Left            =   4560
  90.       Picture         =   BLANKER.FRX:1348
  91.       Top             =   3720
  92.       Visible         =   0   'False
  93.       Width           =   480
  94.    End
  95.    Begin Image imgMoon 
  96.       Height          =   480
  97.       Index           =   4
  98.       Left            =   3960
  99.       Picture         =   BLANKER.FRX:164A
  100.       Top             =   3720
  101.       Visible         =   0   'False
  102.       Width           =   480
  103.    End
  104.    Begin Image imgMoon 
  105.       Height          =   480
  106.       Index           =   3
  107.       Left            =   3360
  108.       Picture         =   BLANKER.FRX:194C
  109.       Top             =   3720
  110.       Visible         =   0   'False
  111.       Width           =   480
  112.    End
  113.    Begin Image imgMoon 
  114.       Height          =   480
  115.       Index           =   2
  116.       Left            =   2760
  117.       Picture         =   BLANKER.FRX:1C4E
  118.       Top             =   3720
  119.       Visible         =   0   'False
  120.       Width           =   480
  121.    End
  122.    Begin Image imgMoon 
  123.       Height          =   480
  124.       Index           =   1
  125.       Left            =   2160
  126.       Picture         =   BLANKER.FRX:1F50
  127.       Top             =   3720
  128.       Visible         =   0   'False
  129.       Width           =   480
  130.    End
  131.    Begin Image imgMoon 
  132.       Height          =   480
  133.       Index           =   0
  134.       Left            =   1560
  135.       Picture         =   BLANKER.FRX:2252
  136.       Top             =   3720
  137.       Visible         =   0   'False
  138.       Width           =   480
  139.    End
  140.    Begin Shape shpClone 
  141.       BackColor       =   &H00000000&
  142.       BackStyle       =   1  'Opaque
  143.       BorderColor     =   &H00FF0000&
  144.       FillColor       =   &H000000FF&
  145.       Height          =   1215
  146.       Index           =   0
  147.       Left            =   240
  148.       Top             =   720
  149.       Visible         =   0   'False
  150.       Width           =   1410
  151.    End
  152.    Begin Shape Shape1 
  153.       Height          =   15
  154.       Left            =   960
  155.       Top             =   1080
  156.       Width           =   15
  157.    End
  158.    Begin Menu mnuOption 
  159.       Caption         =   "&Options"
  160.       Begin Menu mnuLineCtlDemo 
  161.          Caption         =   "&Jumpy Line"
  162.          Checked         =   -1  'True
  163.       End
  164.       Begin Menu mnuCtlMoveDemo 
  165.          Caption         =   "Re&bound"
  166.       End
  167.       Begin Menu mnuImageDemo 
  168.          Caption         =   "&Spinning Moon"
  169.       End
  170.       Begin Menu mnuShapeDemo 
  171.          Caption         =   "&Madhouse"
  172.       End
  173.       Begin Menu mnuPSetDemo 
  174.          Caption         =   "&Confetti"
  175.       End
  176.       Begin Menu mnuLineDemo 
  177.          Caption         =   "C&rossfire"
  178.       End
  179.       Begin Menu mnuCircleDemo 
  180.          Caption         =   "Rainbo&w Rug"
  181.       End
  182.       Begin Menu mnuScaleDemo 
  183.          Caption         =   "Co&lor Bars"
  184.       End
  185.       Begin Menu sep1 
  186.          Caption         =   "-"
  187.       End
  188.       Begin Menu mnuExit 
  189.          Caption         =   "E&xit"
  190.       End
  191.    End
  192. Option Explicit
  193. ' Declare variable to track animation frame
  194. Dim Shared FrameNum
  195. ' Declare the X and Y-coordinate variables to track position.
  196. Dim Shared XPos
  197. Dim Shared YPos
  198. ' Declare variable flag to stop graphic routines in Do Loops
  199. Dim Shared DoFlag
  200. ' Declare variable to track moving controls
  201. Dim Shared Motion
  202. ' Declare form variables for color.
  203. Dim R
  204. Dim G
  205. Dim B
  206. Sub CircleDemo ()
  207.     ' Declare local variables
  208.     Dim Radius
  209.     ' Create random RGB colors
  210.     R = 255 * Rnd
  211.     G = 255 * Rnd
  212.     B = 255 * Rnd
  213.     ' Position center of circles in form center
  214.     XPos = ScaleWidth / 2
  215.     YPos = ScaleHeight / 2
  216.     ' Generate radius between 0 and almost half form height
  217.     Radius = ((YPos * .9) + 1) * Rnd
  218.     ' Draw circle on form
  219.     Circle (XPos, YPos), Radius, RGB(R, G, B)
  220. End Sub
  221. Sub cmdStartStop_Click ()
  222. ' Declare local variables.
  223. Dim UnClone
  224. Dim MakeClone
  225. Dim X1
  226. Dim Y1
  227.     Select Case DoFlag
  228.     Case True
  229.         cmdStartStop.Caption = "Start Demo"
  230.         DoFlag = False
  231.         mnuOption.Enabled = True
  232.         If mnuCtlMoveDemo.Checked = True Then
  233.         ' Hide bouncing graphic again.
  234.         picBall.Visible = False
  235.         ElseIf mnuLineDemo.Checked = True Then
  236.         ' Remove lines from the form.
  237.         Cls
  238.         ElseIf mnuShapeDemo.Checked = True Then
  239.         ' Remove all dynamically loaded Shape controls.
  240.         For UnClone = 1 To 20
  241.             Unload shpClone(UnClone)
  242.         Next UnClone
  243.         ' Reset background color of form to black.
  244.         DemoForm.BackColor = QBColor(0)
  245.         ' Refresh form so color change takes effect.
  246.         Refresh
  247.         ElseIf mnuPSetDemo.Checked = True Then
  248.         ' Remove confetti bits from form.
  249.         Cls
  250.         ElseIf mnuLineCtlDemo.Checked = True Then
  251.         ' Hide Line control again.
  252.         linLineCtl.Visible = False
  253.         ' Remove any stray pixels left after hiding line.
  254.         Cls
  255.         ElseIf mnuImageDemo.Checked = True Then
  256.         ' Hide bouncing graphic again.
  257.         imgMoon(0).Visible = False
  258.         ElseIf mnuScaleDemo.Checked = True Then
  259.         ' Clear form.
  260.         Cls
  261.         ' Return form to the default scale.
  262.         Scale
  263.         ElseIf mnuCircleDemo.Checked = True Then
  264.         ' Remove the circles from form.
  265.         Cls
  266.         End If
  267.     Case False
  268.         cmdStartStop.Caption = "Stop Demo"
  269.         DoFlag = True
  270.         mnuOption.Enabled = False
  271.         If mnuCtlMoveDemo.Checked = True Then
  272.         ' Make the bouncing graphic (Picture box control) visible.
  273.         picBall.Visible = True
  274.         ' Determine initial motion of bouncing graphic at random.
  275.         ' Settings are 1 to 4.  Value of variable Motion determines
  276.         ' what part of the Do Loop routine runs.
  277.         Motion = Int(4 * Rnd + 1)
  278.         ElseIf mnuLineDemo.Checked = True Then
  279.         ' Initialize random-number generator.
  280.         Randomize
  281.         ' Set line width
  282.         DrawWidth = 2
  283.         ' Set initial X and Y-coordinates to a random spot on form
  284.         X1 = Int(DemoForm.Width * Rnd + 1)
  285.         Y1 = Int(DemoForm.Height * Rnd + 1)
  286.         ElseIf mnuShapeDemo.Checked = True Then
  287.         ' Dynamically load a control array of 20 Shape controls on the form.
  288.         For MakeClone = 1 To 20
  289.             Load shpClone(MakeClone)
  290.         Next MakeClone
  291.         ElseIf mnuPSetDemo.Checked = True Then
  292.         ' Set thickness of confetti bits.
  293.         DrawWidth = 5
  294.         ElseIf mnuLineCtlDemo.Checked = True Then
  295.         ' Make Line control visible.
  296.         linLineCtl.Visible = True
  297.         ' Set thickness of line as it will appear.
  298.         DrawWidth = 7
  299.         ElseIf mnuImageDemo.Checked = True Then
  300.         ' Make bouncing graphic (Image control) visible.
  301.         imgMoon(0).Visible = True
  302.         ' Set initial animation frame
  303.         FrameNum = 0
  304.         ' Determine initial motion of bouncing graphic at random.
  305.         ' Settings are 1 to 4.  Value of variable Motion determines
  306.         ' what part of the Do Loop routine runs.
  307.         Motion = Int(4 * Rnd + 1)
  308.         ElseIf mnuScaleDemo.Checked = True Then
  309.         ' Initialize random-number generator.
  310.         Randomize
  311.         ' Set width of box outlines so boxes don't overlap.
  312.         DrawWidth = 1
  313.         ' Set value of X-coordinate of left edge of form. Then the 1st to 1 to easily
  314.         ' box has X-coordinate = 1, 2nd box = 2, etc.
  315.         ScaleLeft = 1
  316.         ' Set Y-coordinate of top edge of form to 10.
  317.         ScaleTop = 10
  318.         ' Set # of units in form width to a random number between
  319.         ' 3 and 12.  This changes # of boxes drawn each time the
  320.         ' routine starts
  321.         ScaleWidth = Int(13 * Rnd + 3)
  322.         ' Set # of units in form height -10.  Then height of all boxes
  323.         ' varies from 0 to 10 and Y-coordinates start at form bottom
  324.         ScaleHeight = -10
  325.         ElseIf mnuCircleDemo.Checked = True Then
  326.         ' Define width of circle outline.
  327.         DrawWidth = 1
  328.         ' Draw circles as dashed lines.
  329.         DrawStyle = 1
  330.         ' Draw lines using the XOR pen, combining colors found in the pen and
  331.         ' in the display but not in both.
  332.         DrawMode = 7
  333.         End If
  334.     End Select
  335. End Sub
  336. Sub CtlMoveDemo ()
  337.     Select Case Motion
  338.     Case 1
  339.     ' Move graphic left/up by 20 twips using Move method
  340.     picBall.Move picBall.Left - 20, picBall.Top - 20
  341.     ' If graphic reaches left edge of form, move it right/up
  342.     If picBall.Left <= 0 Then
  343.         Motion = 2
  344.     ' If graphic reaches top edge of form, move it left/down
  345.     ElseIf picBall.Top <= 0 Then
  346.         Motion = 4
  347.     End If
  348.     Case 2
  349.     ' Move graphic right/up by 20 twips
  350.     picBall.Move picBall.Left + 20, picBall.Top - 20
  351.     ' If the graphic reaches right edge of form, move left/up.
  352.     ' Routine determines right edge of form by subtracting graphic
  353.     ' width from form width
  354.     If picBall.Left >= (DemoForm.Width - picBall.Width) Then
  355.         Motion = 1
  356.     ' If graphic reaches top edge of form, move right/down
  357.     ElseIf picBall.Top <= 0 Then
  358.         Motion = 3
  359.     End If
  360.     Case 3
  361.     ' Move graphic right/down by 20 twips
  362.     picBall.Move picBall.Left + 20, picBall.Top + 20
  363.     ' If graphic reaches right edge of form, move left/down
  364.     If picBall.Left >= (DemoForm.Width - picBall.Width) Then
  365.         Motion = 4
  366.     ' If graphic reaches bottom edge of form, move right/up.
  367.     ' Routine determines bottom of form by subtracting
  368.     ' graphic height from form height less 680 twips for height
  369.     ' of title bar and menu bar
  370.     ElseIf picBall.Top >= (DemoForm.Height - picBall.Height) - 680 Then
  371.         Motion = 2
  372.     End If
  373.     Case 4
  374.     ' Move the graphic left/down by 20 twips
  375.     picBall.Move picBall.Left - 20, picBall.Top + 20
  376.     ' If graphic reaches left edge of form, move right/down
  377.     If picBall.Left <= 0 Then
  378.         Motion = 3
  379.     ' If graphic reaches bottom edge of the form, move left/up
  380.     ElseIf picBall.Top >= (DemoForm.Height - picBall.Height) - 680 Then
  381.         Motion = 1
  382.     End If
  383.     End Select
  384. End Sub
  385. Sub Delay ()
  386.     Dim Start
  387.     Dim Check
  388.     Start = Timer
  389.     Do Until Check >= Start + .15
  390.     Check = Timer
  391.     Loop
  392. End Sub
  393. Sub Form_Load ()
  394.     DoFlag = False
  395. End Sub
  396. Sub Form_Resize ()
  397.     If mnuScaleDemo.Checked = True Then
  398.     ' Initialize the random-number generator.
  399.     Randomize
  400.     ' Set the width of the box outlines to narrow so the boxes don't overlap.
  401.     DrawWidth = 1
  402.     ' Set the value of the X-coordinate of the left edge of the form to 1.
  403.     ' This makes it easy to set the position for each box.  The first box has
  404.     ' an X-coordinate of 1, the second has an X-coordinate of 2, etc.
  405.     ScaleLeft = 1
  406.     ' Set the value of the Y-coordinate of the top edge of the form to 10.
  407.     ScaleTop = 10
  408.     ' Set the number of units in the width of the form to a random number between
  409.     ' 3 and 12.  This changes the number of boxes that are drawn each time the user
  410.     ' starts this routine.
  411.     ScaleWidth = Int(13 * Rnd + 3)
  412.     ' Set the number of units in the height of the form to negative 10.  This has
  413.     ' two effects.  First, all the boxes then have a height that varies from 0 to 10.
  414.     ' Second, the negative value causes the Y-coordinates to begin at the bottom
  415.     ' edge of the form instead of at the top.
  416.     ScaleHeight = -10
  417.     End If
  418. End Sub
  419. Sub Form_Unload (Cancel As Integer)
  420.     End
  421. End Sub
  422. Sub ImageDemo ()
  423.     Select Case Motion
  424.     Case 1
  425.     ' Move graphic left/up by 100 twips using Move method
  426.     imgMoon(0).Move imgMoon(0).Left - 100, imgMoon(0).Top - 100
  427.     ' Increment animation to next frame
  428.     IncrFrame
  429.     ' If graphic reaches left edge of form, move right/up
  430.     If imgMoon(0).Left <= 0 Then
  431.         Motion = 2
  432.     ' If graphic reaches top edge of the form, move left/down
  433.     ElseIf imgMoon(0).Top <= 0 Then
  434.         Motion = 4
  435.     End If
  436.     Case 2
  437.     ' Move graphic right/up by 100 twips
  438.     imgMoon(0).Move imgMoon(0).Left + 100, imgMoon(0).Top - 100
  439.     ' Increment animation to next frame
  440.     IncrFrame
  441.     ' If graphic reaches right edge of form, move left/up.
  442.     ' Routine determines the right edge of form by subtracting
  443.     ' graphic width from control width
  444.     If imgMoon(0).Left >= (DemoForm.Width - imgMoon(0).Width) Then
  445.         Motion = 1
  446.     ' If graphic reaches top edge of the form, move right/down
  447.     ElseIf imgMoon(0).Top <= 0 Then
  448.         Motion = 3
  449.     End If
  450.     Case 3
  451.     ' Move graphic right/down by 100 twips
  452.     imgMoon(0).Move imgMoon(0).Left + 100, imgMoon(0).Top + 100
  453.     ' Increment animation to next frame
  454.     IncrFrame
  455.     ' If graphic reaches right edge of form, move left/down
  456.     If imgMoon(0).Left >= (DemoForm.Width - imgMoon(0).Width) Then
  457.         Motion = 4
  458.     ' If graphic reaches bottom edge of form, move right/up.
  459.     ' Routine determines bottom edge of form by subtracting graphic
  460.     ' height from form height minus 680 twips for height of title
  461.     ' bar and menu bar
  462.     ElseIf imgMoon(0).Top >= (DemoForm.Height - imgMoon(0).Height) - 680 Then
  463.         Motion = 2
  464.     End If
  465.     Case 4
  466.     ' Move graphic left/down by 100 twips
  467.     imgMoon(0).Move imgMoon(0).Left - 100, imgMoon(0).Top + 100
  468.     ' Increment animation to next frame
  469.     IncrFrame
  470.     ' If graphic reaches left edge of form, move right/down
  471.     If imgMoon(0).Left <= 0 Then
  472.         Motion = 3
  473.     ' If graphic reaches bottom edge of form, move left/up
  474.     ElseIf imgMoon(0).Top >= (DemoForm.Height - imgMoon(0).Height) - 680 Then
  475.         Motion = 1
  476.     End If
  477.     End Select
  478. End Sub
  479. Sub IncrFrame ()
  480.     ' Increment frame #
  481.     FrameNum = FrameNum + 1
  482.     ' Control array with animation frames has elements 0 to 7. At the 8th
  483.     ' frame, reset the frame # to 0 for endless animation loop
  484.     If FrameNum > 8 Then
  485.     FrameNum = 1
  486.     End If
  487.     ' Set Picture property of image control to Picture property of current
  488.     ' frame
  489.     imgMoon(0).Picture = imgMoon(FrameNum).Picture
  490.     ' Pause display so animation isn't too fast
  491.     Delay
  492. End Sub
  493. Sub LineCtlDemo ()
  494.     ' Set X and Y-coordinates (left/right position) of line's start to
  495.     ' random spot on form
  496.     linLineCtl.X1 = Int(DemoForm.Width * Rnd)
  497.     linLineCtl.Y1 = Int(DemoForm.Height * Rnd)
  498.     ' Set X and Y-coordinates (left/right position) of line's end to
  499.     ' random spot on form
  500.     linLineCtl.X2 = Int(DemoForm.Width * Rnd)
  501.     linLineCtl.Y2 = Int(DemoForm.Height * Rnd)
  502.     ' Clear form to remove any stray pixels
  503.     Cls
  504.     ' Pause display before moving line again
  505.     Delay
  506. End Sub
  507. Sub LineDemo ()
  508.     ' Declare local variables
  509.     Dim X2
  510.     Dim Y2
  511.     ' Create random RGB colors
  512.     R = 255 * Rnd
  513.     G = 255 * Rnd
  514.     B = 255 * Rnd
  515.     ' Set end point of line to random spot on form
  516.     X2 = Int(DemoForm.Width * Rnd + 1)
  517.     Y2 = Int(DemoForm.Height * Rnd + 1)
  518.     ' Using Line method, draw from current coordinates to current end
  519.     ' point, giving line a random color. Each line starts where last
  520.     ' line ends.
  521.     Line -(X2, Y2), RGB(R, G, B)
  522. End Sub
  523. Sub mnuCircleDemo_Click ()
  524.     Cls
  525.     mnuCtlMoveDemo.Checked = False
  526.     mnuLineDemo.Checked = False
  527.     mnuShapeDemo.Checked = False
  528.     mnuPSetDemo.Checked = False
  529.     mnuLineCtlDemo.Checked = False
  530.     mnuImageDemo.Checked = False
  531.     mnuScaleDemo.Checked = False
  532.     mnuCircleDemo.Checked = True
  533. End Sub
  534. Sub mnuCtlMoveDemo_Click ()
  535.     Cls
  536.     mnuCtlMoveDemo.Checked = True
  537.     mnuLineDemo.Checked = False
  538.     mnuShapeDemo.Checked = False
  539.     mnuPSetDemo.Checked = False
  540.     mnuLineCtlDemo.Checked = False
  541.     mnuImageDemo.Checked = False
  542.     mnuScaleDemo.Checked = False
  543.     mnuCircleDemo.Checked = False
  544. End Sub
  545. Sub mnuExit_Click ()
  546.     End
  547. End Sub
  548. Sub mnuImageDemo_Click ()
  549.     Cls
  550.     mnuCtlMoveDemo.Checked = False
  551.     mnuLineDemo.Checked = False
  552.     mnuShapeDemo.Checked = False
  553.     mnuPSetDemo.Checked = False
  554.     mnuLineCtlDemo.Checked = False
  555.     mnuImageDemo.Checked = True
  556.     mnuScaleDemo.Checked = False
  557.     mnuCircleDemo.Checked = False
  558. End Sub
  559. Sub mnuLineCtlDemo_Click ()
  560.     Cls
  561.     mnuCtlMoveDemo.Checked = False
  562.     mnuLineDemo.Checked = False
  563.     mnuShapeDemo.Checked = False
  564.     mnuPSetDemo.Checked = False
  565.     mnuLineCtlDemo.Checked = True
  566.     mnuImageDemo.Checked = False
  567.     mnuScaleDemo.Checked = False
  568.     mnuCircleDemo.Checked = False
  569. End Sub
  570. Sub mnuLineDemo_Click ()
  571.     Cls
  572.     mnuCtlMoveDemo.Checked = False
  573.     mnuLineDemo.Checked = True
  574.     mnuShapeDemo.Checked = False
  575.     mnuPSetDemo.Checked = False
  576.     mnuLineCtlDemo.Checked = False
  577.     mnuImageDemo.Checked = False
  578.     mnuScaleDemo.Checked = False
  579.     mnuCircleDemo.Checked = False
  580. End Sub
  581. Sub mnuPSetDemo_Click ()
  582.     Cls
  583.     mnuCtlMoveDemo.Checked = False
  584.     mnuLineDemo.Checked = False
  585.     mnuShapeDemo.Checked = False
  586.     mnuPSetDemo.Checked = True
  587.     mnuLineCtlDemo.Checked = False
  588.     mnuImageDemo.Checked = False
  589.     mnuScaleDemo.Checked = False
  590.     mnuCircleDemo.Checked = False
  591. End Sub
  592. Sub mnuScaleDemo_Click ()
  593.     Cls
  594.     mnuCtlMoveDemo.Checked = False
  595.     mnuLineDemo.Checked = False
  596.     mnuShapeDemo.Checked = False
  597.     mnuPSetDemo.Checked = False
  598.     mnuLineCtlDemo.Checked = False
  599.     mnuImageDemo.Checked = False
  600.     mnuScaleDemo.Checked = True
  601.     mnuCircleDemo.Checked = False
  602. End Sub
  603. Sub mnuShapeDemo_Click ()
  604.     Cls
  605.     mnuCtlMoveDemo.Checked = False
  606.     mnuLineDemo.Checked = False
  607.     mnuShapeDemo.Checked = True
  608.     mnuPSetDemo.Checked = False
  609.     mnuLineCtlDemo.Checked = False
  610.     mnuImageDemo.Checked = False
  611.     mnuScaleDemo.Checked = False
  612.     mnuCircleDemo.Checked = False
  613. End Sub
  614. Sub PSetDemo ()
  615.     ' Create random RGB colors
  616.     R = 255 * Rnd
  617.     G = 255 * Rnd
  618.     B = 255 * Rnd
  619.     ' Xpos sets horiz position of confetti bit to random spot on form
  620.     XPos = Rnd * ScaleWidth
  621.     ' YPos sets vertical position of confetti bit to random spot on form
  622.     YPos = Rnd * ScaleHeight
  623.     ' Draw confetti bit at XPos, Ypos. Assign confetti bit a random color
  624.     PSet (XPos, YPos), RGB(R, G, B)
  625. End Sub
  626. Sub ScaleDemo ()
  627.     ' Declare local variables
  628.     Dim Box
  629.     ' Creates same number of boxes as units in the width of form
  630.     For Box = 1 To ScaleWidth
  631.     ' Create random RGB colors
  632.     R = 255 * Rnd
  633.     G = 255 * Rnd
  634.     B = 255 * Rnd
  635.     ' Draw boxes using te Line method with B (box) F (filled) options.
  636.     ' Boxes start at each X-coordinate determined by ScaleWidth and at
  637.     ' a Y-coordinate of 0 (bottom of form). Each box is 1 unit wide and
  638.     ' has a random height between 0 and 10. Fill box with random color.
  639.     Line (Box, 0)-Step(1, (Int(11 * Rnd))), RGB(R, G, B), BF
  640.     Next Box
  641.     ' Pause to display all boxes before redraw
  642.     Delay
  643. End Sub
  644. Sub ShapeDemo ()
  645.     ' Declare local variables
  646.     Dim CloneID
  647.     ' Create random RGB colors
  648.     R = 255 * Rnd
  649.     G = 255 * Rnd
  650.     B = 255 * Rnd
  651.     ' Set form background color to random value
  652.     DemoForm.BackColor = RGB(R, G, B)
  653.     ' Select random Shape control in control array
  654.     CloneID = Int(20 * Rnd + 1)
  655.     ' XPos and Ypos set position of selected Shape control to random
  656.     ' spot on the form.
  657.     XPos = Int(DemoForm.Width * Rnd + 1)
  658.     YPos = Int(DemoForm.Height * Rnd + 1)
  659.     ' Set the shape of the selected Shape control to a random shape.
  660.     shpClone(CloneID).Shape = Int(6 * Rnd)
  661.     ' Set height/width of selected Shape control to random size between
  662.     ' 500 and 2500 twips
  663.     shpClone(CloneID).Height = Int(2501 * Rnd + 500)
  664.     shpClone(CloneID).Width = Int(2501 * Rnd + 500)
  665.     ' Set background color and DrawMode of Shape control to random color
  666.     shpClone(CloneID).BackColor = QBColor(Int(15 * Rnd))
  667.     shpClone(CloneID).DrawMode = Int(16 * Rnd + 1)
  668.     ' Move selected Shape control using Move method to XPos, YPos
  669.     shpClone(CloneID).Move XPos, YPos
  670.     ' Make the selected Shape control visible.
  671.     shpClone(CloneID).Visible = True
  672.     ' Wait briefly before selecting and changing the next Shape control.
  673.     Delay
  674. End Sub
  675. Sub Timer1_Timer ()
  676.     If mnuCtlMoveDemo.Checked And DoFlag = True Then
  677.     CtlMoveDemo
  678.     ElseIf mnuLineDemo.Checked And DoFlag = True Then
  679.     LineDemo
  680.     ElseIf mnuShapeDemo.Checked And DoFlag = True Then
  681.     ShapeDemo
  682.     ElseIf mnuPSetDemo.Checked And DoFlag = True Then
  683.     PSetDemo
  684.     ElseIf mnuLineCtlDemo.Checked And DoFlag = True Then
  685.     LineCtlDemo
  686.     ElseIf mnuImageDemo.Checked And DoFlag = True Then
  687.     ImageDemo
  688.     ElseIf mnuScaleDemo.Checked And DoFlag = True Then
  689.     ScaleDemo
  690.     ElseIf mnuCircleDemo.Checked And DoFlag = True Then
  691.     CircleDemo
  692.     End If
  693. End Sub
  694.