home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l406 / 1.ddi / BLANKER.FR_ / BLANKER.bin (.txt)
Encoding:
Visual Basic Form  |  1992-10-21  |  21.7 KB  |  681 lines

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