home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Windows 95 Special 2 / WIN95_2.bin / utils / envelop / envelop.6 / Tools / Bootcamp / basic / scrolbar / scrolbar.eto < prev    next >
Encoding:
Text File  |  1996-07-08  |  17.0 KB  |  647 lines

  1. Type ScrollBarMasterForm From SampleMasterForm
  2.   Dim Label1 As New Label
  3.   Dim lblSizeBox As New Label
  4.   Dim sbrHorizontal As New ScrollBar
  5.   Dim sbrVertical As New ScrollBar
  6.   Dim Label2 As New Label
  7.   Dim sbrRed As New ScrollBar
  8.   Dim sbrGreen As New ScrollBar
  9.   Dim sbrBlue As New ScrollBar
  10.   Dim Label3 As New Label
  11.   Dim Label4 As New Label
  12.   Dim Label5 As New Label
  13.   Dim ctrlColor As New Control
  14.   Dim lblRed As New Label
  15.   Dim lblGreen As New Label
  16.   Dim lblBlue As New Label
  17.   Dim Label6 As New Label
  18.   Dim lblColorValue As New Label
  19.   Dim Label8 As New Label
  20.   Dim Label9 As New Label
  21.   Dim Label10 As New Label
  22.   Dim sbrHue As New ScrollBar
  23.   Dim sbrSaturation As New ScrollBar
  24.   Dim sbrValue As New ScrollBar
  25.   Dim lblHue As New Label
  26.   Dim lblSaturation As New Label
  27.   Dim lblValue As New Label
  28.   Dim ChangeFlag As Integer
  29.   Dim GotFocusFlag As Integer
  30.   Dim RED As Integer
  31.   Dim GREEN As Integer
  32.   Dim BLUE As Integer
  33.   Dim HUE As Integer
  34.   Dim SATURATION As Integer
  35.   Dim VALUE As Integer
  36.   Dim LoopBack As Integer
  37.   Dim Label7 As New Label
  38.   Dim txtColorValue As New TextBox
  39.   Dim Label11 As New Label
  40.   Dim cmdConvert As New Button
  41.   Dim Label12 As New Label
  42.   Dim Label13 As New Label
  43.   Dim lblGreenValue As New Label
  44.   Dim lblRedValue As New Label
  45.   Dim Label15 As New Label
  46.   Dim lblBlueValue As New Label
  47.  
  48.   ' METHODS for object: ScrollBarMasterForm
  49.   Sub sbrHorizontal_Change()
  50.     lblSizeBox.Left = 2700 - ((sbrHorizontal.Value - 450) / 2)
  51.     lblSizeBox.Width = sbrHorizontal.Value
  52.     sbrHorizontal.Refresh
  53.   End Sub
  54.  
  55.   Sub sbrVertical_Change()
  56.     lblSizeBox.Top = 1050 - ((sbrVertical.Value - 450) / 2)
  57.     lblSizeBox.Height = sbrVertical.Value
  58.     sbrVertical.Refresh
  59.   End Sub
  60.  
  61.   Sub sbrRed_GotFocus()
  62.     GotFocusFlag = 1
  63.   End Sub
  64.  
  65.   Sub sbrGreen_GotFocus()
  66.     GotFocusFlag = 2
  67.   End Sub
  68.  
  69.   Sub sbrBlue_GotFocus()
  70.     GotFocusFlag = 3
  71.   End Sub
  72.  
  73.   Sub sbrHue_GotFocus()
  74.     GotFocusFlag = 4
  75.   End Sub
  76.  
  77.   Sub sbrValue_GotFocus()
  78.     GotFocusFlag = 6
  79.   End Sub
  80.  
  81.   Sub sbrRed_Scroll()
  82.     sbrRed_Change
  83.   End Sub
  84.  
  85.   Sub sbrGreen_Scroll()
  86.     sbrGreen_Change
  87.   End Sub
  88.  
  89.   Sub sbrBlue_Scroll()
  90.     sbrBlue_Change
  91.   End Sub
  92.  
  93.   Sub sbrHue_Scroll()
  94.     sbrHue_Change
  95.   End Sub
  96.  
  97.   Sub sbrSaturation_Scroll()
  98.     sbrSaturation_Change
  99.   End Sub
  100.  
  101.   Sub sbrValue_Scroll()
  102.     sbrValue_Change
  103.   End Sub
  104.  
  105.   Sub sbrHue_Change()
  106.     ChangeFlag = 4
  107.     lblHue.Caption = sbrHue.Value
  108.     UpdateColor
  109.     sbrHue.Refresh
  110.   End Sub
  111.  
  112.   Sub sbrSaturation_Change()
  113.     ChangeFlag = 5
  114.     lblSaturation.Caption = sbrSaturation.Value
  115.     UpdateColor
  116.     sbrSaturation.Refresh
  117.   End Sub
  118.  
  119.   Sub sbrValue_Change()
  120.     ChangeFlag = 6
  121.     lblValue.Caption = sbrValue.Value
  122.     UpdateColor
  123.     sbrValue.Refresh
  124.   End Sub
  125.  
  126.   Sub sbrRed_Change()
  127.     ChangeFlag = 1
  128.     lblRed.Caption = sbrRed.Value
  129.     UpdateColor
  130.     sbrRed.Refresh
  131.   End Sub
  132.  
  133.   Sub sbrBlue_Change()
  134.     ChangeFlag = 3
  135.     lblBlue.Caption = sbrBlue.Value
  136.     UpdateColor
  137.     sbrBlue.Refresh
  138.   End Sub
  139.  
  140.   Sub sbrSaturation_GotFocus()
  141.     GotFocusFlag = 5
  142.   End Sub
  143.  
  144.   Sub sbrGreen_Change()
  145.     ChangeFlag = 2
  146.     lblGreen.Caption = sbrGreen.Value
  147.     UpdateColor
  148.     sbrGreen.Refresh
  149.   End Sub
  150.  
  151.   Sub UpdateColor()
  152.     Dim rgb_value As Long
  153.   
  154.     ' If this routine is being called because of a scrollbar value being updated
  155.     ' then bypass this routine
  156.     If LoopBack == 1 Then Exit Sub
  157.   
  158.     ' Be sure scroll bars are coordinated
  159.     If ChangeFlag > 0 And ChangeFlag == GotFocusFlag Then 
  160.       If ChangeFlag < 4 Then 
  161.         ' Get current RGB scroll bar values
  162.         RED = sbrRed.Value
  163.         GREEN = sbrGreen.Value
  164.         BLUE = sbrBlue.Value
  165.   
  166.         ' Convert RGB to HSV
  167.         RGB2HSV
  168.   
  169.         ' Set HSV scroll bars
  170.         LoopBack = 1
  171.         sbrHue.Value = HUE
  172.         sbrSaturation.Value = SATURATION
  173.         sbrValue.Value = VALUE
  174.         LoopBack = 0
  175.       Else 
  176.         ' Get current HSV scroll bar values
  177.         HUE = sbrHue.Value
  178.         SATURATION = sbrSaturation.Value
  179.         VALUE = sbrValue.Value
  180.   
  181.         ' Convert HSV to RGB
  182.         HSV2RGB
  183.   
  184.         ' Set RGB scrollbars
  185.         LoopBack = 1
  186.         sbrRed.Value = RED
  187.         sbrGreen.Value = GREEN
  188.         sbrBlue.Value = BLUE
  189.         LoopBack = 0
  190.       End If
  191.     End If
  192.   
  193.     ' Get RGB scroll bar values
  194.     RED = sbrRed.Value
  195.     GREEN = sbrGreen.Value
  196.     BLUE = sbrBlue.Value
  197.   
  198.     ' Convert R, G, and B values to long color value
  199.     rgb_value = RGB(RED, GREEN, BLUE)
  200.   
  201.     ' Display color in picture box
  202.     ctrlColor.BackColor = rgb_value
  203.   
  204.     ' Display long color value
  205.     lblColorValue.Caption = "H" & Hex(rgb_value)
  206.   
  207.   
  208.     ' ctrlColor.BackColor = RGB(sbrRed.Value, sbrGreen.Value, sbrBlue.Value)
  209.     ' Update the value labels for each color
  210.     ' lblRedValue.Caption = sbrRed.Value
  211.     ' lblGreenValue.Caption = sbrGreen.Value
  212.     ' lblBlueValue.Caption = sbrBlue.Value
  213.   End Sub
  214.  
  215.   Sub HSV2RGB()
  216.     Dim red As Single
  217.     Dim green As Single
  218.     Dim blue As Single
  219.     Dim saturation As Single
  220.     Dim value As Single
  221.     Dim hue_value As Single
  222.     Dim i As Integer
  223.     Dim f, p, q, t As Single
  224.   
  225.     saturation = SATURATION / 100.0
  226.     value = VALUE / 100.0
  227.     If SATURATION == 0 Then 
  228.       red = value
  229.       green = value
  230.       blue = value
  231.     Else 
  232.       hue_value = HUE / 60.0
  233.       If hue_value == 6 Then hue_value = 0
  234.       i = int(hue_value)
  235.       f = hue_value - i
  236.       p = value * (1 - saturation)
  237.       q = value * (1 - (saturation * f))
  238.       t = value * (1 - (saturation * (1 - f)))
  239.       Select Case i
  240.         Case 0
  241.           red = value
  242.           green = t
  243.           blue = p
  244.         Case 1
  245.           red = q
  246.           green = value
  247.           blue = p
  248.         Case 2
  249.           red = p
  250.           green = value
  251.           blue = t
  252.         Case 3
  253.           red = p
  254.           green = q
  255.           blue = value
  256.         Case 4
  257.           red = t
  258.           green = p
  259.           blue = value
  260.         Case 5
  261.           red = value
  262.           green = p
  263.           blue = q
  264.       End Select
  265.     End If
  266.   
  267.     RED = int(255.9999 * red)
  268.     GREEN = int(255.9999 * green)
  269.     BLUE = int(255.9999 * blue)
  270.   
  271.   End Sub
  272.  
  273.   Sub RGB2HSV ()
  274.     Dim value_red As Single
  275.     Dim value_green As Single
  276.     Dim value_blue As Single
  277.     Dim max As Single
  278.     Dim min As Single
  279.     Dim red_color As Single
  280.     Dim green_color As Single
  281.     Dim blue_color As Single
  282.     Dim value_value As Single
  283.     Dim saturation_value As Single
  284.     Dim hue_value As Single
  285.   
  286.     value_red = RED / 255.0
  287.     value_green = GREEN / 255.0
  288.     value_blue = BLUE / 255.0
  289.   
  290.     max = value_red
  291.     If value_green > max Then max = value_green
  292.     If value_blue > max Then max = value_blue
  293.   
  294.     min = value_red
  295.     If value_green < min Then min = value_green
  296.     If value_blue < min Then min = value_blue
  297.   
  298.     value_value = max
  299.     If max <> 0 Then 
  300.       saturation_value = (max - min) / max
  301.     Else 
  302.       saturation_value = 0
  303.     End If
  304.     If saturation_value == 0 Then 
  305.       HUE = 0
  306.     Else 
  307.       red_color = (max - value_red) / (max - min)
  308.       green_color = (max - value_green) / (max - min)
  309.       blue_color = (max - value_blue) / (max - min)
  310.       Select Case max
  311.         Case value_red
  312.           hue_value = blue_color - green_color
  313.         Case value_green
  314.           hue_value = 2 + red_color - blue_color
  315.         Case value_blue
  316.           hue_value = 4 + green_color - red_color
  317.       End Select
  318.       hue_value = hue_value * 60
  319.       If hue_value < 0 Then 
  320.         HUE = hue_value + 360
  321.       Else 
  322.         HUE = hue_value
  323.       End If
  324.     End If
  325.   
  326.     SATURATION = saturation_value * 100
  327.     VALUE = value_value * 100
  328.   
  329.   End Sub
  330.  
  331.   Sub ResetApplication_Click ()
  332.   
  333.     ' Initialize the ScrollBar start positions
  334.     sbrHorizontal.Value = 450
  335.     sbrVertical.Value = 450
  336.   
  337.     ' Initialize ScrollBar size box
  338.     lblSizeBox.Left = 2700
  339.     lblSizeBox.Top = 1050
  340.     lblSizeBox.Height = 450
  341.     lblSizeBox.Width = 450
  342.   
  343.     ' Initialize the ScrollBar ranges
  344.     sbrHorizontal.Min = 450
  345.     sbrHorizontal.Max = 4650
  346.     sbrVertical.Min = 450
  347.     sbrVertical.Max = 1050
  348.   
  349.     ' Initialize the ScrollBar increments
  350.     sbrHorizontal.SmallChange = 100
  351.     sbrHorizontal.LargeChange = 1000
  352.     sbrVertical.SmallChange = 100
  353.     sbrVertical.LargeChange = 1000
  354.   
  355.     ' Initialize the color of the Color control
  356.     ctrlColor.BackColor = RGB(0, 0, 0)
  357.   
  358.     ' Initialize the Red, Green, Blue ScrollBars
  359.     sbrRed.Value = 0
  360.     sbrGreen.Value = 0
  361.     sbrBlue.Value = 0
  362.     sbrRed.Min = 0
  363.     sbrRed.Max = 255
  364.     sbrRed.SmallChange = 1
  365.     sbrRed.LargeChange = 20
  366.     sbrGreen.Min = 0
  367.     sbrGreen.Max = 255
  368.     sbrGreen.SmallChange = 1
  369.     sbrGreen.LargeChange = 20
  370.     sbrBlue.Min = 0
  371.     sbrBlue.Max = 255
  372.     sbrBlue.SmallChange = 1
  373.     sbrBlue.LargeChange = 20
  374.   
  375.     ' Initialize the Hue, Saturation, Value ScrollBars
  376.     sbrHue.Value = 0
  377.     sbrSaturation.Value = 0
  378.     sbrValue.Value = 0
  379.     sbrHue.Min = 0
  380.     sbrHue.Max = 360
  381.     sbrHue.SmallChange = 1
  382.     sbrHue.LargeChange = 20
  383.     sbrSaturation.Min = 0
  384.     sbrSaturation.Max = 100
  385.     sbrSaturation.SmallChange = 1
  386.     sbrSaturation.LargeChange = 20
  387.     sbrValue.Min = 0
  388.     sbrValue.Max = 100
  389.     sbrValue.SmallChange = 1
  390.     sbrValue.LargeChange = 20
  391.   
  392.     ' Initialize the flags, the flags are used to know when a particular scrollbar is
  393.     ' being clicked or scrolled vrs. ones that are being automatically updated.
  394.     ChangeFlag = 1
  395.     GotFocusFlag = 1
  396.     ' flag to prevent loopback calls to UpdateColor routine
  397.     LoopBack = 0
  398.   
  399.     ' Initialize the color conversion
  400.     txtColorValue.Text = ""
  401.     lblRedValue.Caption = ""
  402.     lblGreenValue.Caption = ""
  403.     lblBlueValue.Caption = ""
  404.   
  405.   End Sub
  406.  
  407.   Sub cmdConvert_Click()
  408.     Static colorval As Long
  409.     Dim R, G, B As Integer
  410.   
  411.     If txtColorValue.Text == "" Then 
  412.       InfoBox.Message("", "No color value has been entered.")
  413.       Exit Sub
  414.     End If
  415.   
  416.     ' colorval = Val(txtColorValue.Text)
  417.     colorval = Val(LTrim(txtColorValue.Text) & "&")
  418.   
  419.     lblRedValue.Caption = (colorval And &Hff)
  420.     lblGreenValue.Caption = (colorval And &Hff00) \ 256
  421.     lblBlueValue.Caption = (colorval And &Hff0000) \ 65536
  422.   
  423.   End Sub
  424.  
  425. End Type
  426.  
  427. Begin Code
  428. ' Reconstruction commands for object: ScrollBarMasterForm
  429. '
  430.   With ScrollBarMasterForm
  431.     With .Label1
  432.       .Caption = "1. Click Horizontal and Vertical ScrollBars to change size."
  433.       .ForeColor = 13107200
  434.       .Move(300, 300, 5700, 300)
  435.     End With  'ScrollBarMasterForm.Label1
  436.     With .lblSizeBox
  437.       .BackColor = 16777215
  438.       .Move(2700, 1050, 450, 450)
  439.       .BorderStyle = "Fixed Single"
  440.     End With  'ScrollBarMasterForm.lblSizeBox
  441.     With .sbrHorizontal
  442.       .Move(600, 1950, 4650, 300)
  443.       .Min = 450
  444.       .Max = 4650
  445.       .Value = 450
  446.       .Orientation = "Horizontal"
  447.       .Move(600, 1950, 4650, 300)
  448.     End With  'ScrollBarMasterForm.sbrHorizontal
  449.     With .sbrVertical
  450.       .Move(5700, 750, 300, 1050)
  451.       .Min = 450
  452.       .Max = 1050
  453.       .Value = 450
  454.     End With  'ScrollBarMasterForm.sbrVertical
  455.     With .Label2
  456.       .Caption = "2. Click Red, Green and Blue ScrollBars to change color."
  457.       .ForeColor = 13107200
  458.       .Move(300, 2550, 5700, 300)
  459.     End With  'ScrollBarMasterForm.Label2
  460.     With .sbrRed
  461.       .Move(1500, 3000, 2100, 300)
  462.       .SmallChange = 1
  463.       .LargeChange = 20
  464.       .Max = 255
  465.       .Orientation = "Horizontal"
  466.       .Move(1500, 3000, 2100, 300)
  467.     End With  'ScrollBarMasterForm.sbrRed
  468.     With .sbrGreen
  469.       .Move(1500, 3450, 2100, 300)
  470.       .SmallChange = 1
  471.       .LargeChange = 20
  472.       .Max = 255
  473.       .Orientation = "Horizontal"
  474.       .Move(1500, 3450, 2100, 300)
  475.     End With  'ScrollBarMasterForm.sbrGreen
  476.     With .sbrBlue
  477.       .Move(1500, 3900, 2100, 300)
  478.       .SmallChange = 1
  479.       .LargeChange = 20
  480.       .Max = 255
  481.       .Orientation = "Horizontal"
  482.       .Move(1500, 3900, 2100, 300)
  483.     End With  'ScrollBarMasterForm.sbrBlue
  484.     With .Label3
  485.       .Caption = "Red:"
  486.       .ForeColor = 200
  487.       .Move(450, 3000, 735, 300)
  488.       .Alignment = "Right"
  489.     End With  'ScrollBarMasterForm.Label3
  490.     With .Label4
  491.       .Caption = "Green:"
  492.       .ForeColor = 34560
  493.       .Move(450, 3450, 735, 300)
  494.       .Alignment = "Right"
  495.     End With  'ScrollBarMasterForm.Label4
  496.     With .Label5
  497.       .Caption = "Blue:"
  498.       .ForeColor = 9830400
  499.       .Move(450, 3900, 735, 300)
  500.       .Alignment = "Right"
  501.     End With  'ScrollBarMasterForm.Label5
  502.     With .ctrlColor
  503.       .BackColor = 0
  504.       .Move(4650, 3000, 1350, 1800)
  505.     End With  'ScrollBarMasterForm.ctrlColor
  506.     With .lblRed
  507.       .Caption = "0"
  508.       .Move(3900, 3000, 435, 300)
  509.     End With  'ScrollBarMasterForm.lblRed
  510.     With .lblGreen
  511.       .Caption = "0"
  512.       .Move(3900, 3450, 435, 300)
  513.     End With  'ScrollBarMasterForm.lblGreen
  514.     With .lblBlue
  515.       .Caption = "0"
  516.       .Move(3900, 3900, 435, 300)
  517.     End With  'ScrollBarMasterForm.lblBlue
  518.     With .Label6
  519.       .Caption = "Color Hex No:"
  520.       .Move(4650, 4950, 1350, 300)
  521.     End With  'ScrollBarMasterForm.Label6
  522.     With .lblColorValue
  523.       .Caption = "H0"
  524.       .BackColor = 16777215
  525.       .Move(4650, 5250, 1350, 300)
  526.       .BorderStyle = "Fixed Single"
  527.       .Alignment = "Center"
  528.     End With  'ScrollBarMasterForm.lblColorValue
  529.     With .Label8
  530.       .Caption = "Hue:"
  531.       .Move(300, 4350, 900, 300)
  532.       .Alignment = "Right"
  533.     End With  'ScrollBarMasterForm.Label8
  534.     With .Label9
  535.       .Caption = "Saturation:"
  536.       .Move(150, 4800, 1050, 300)
  537.       .Alignment = "Right"
  538.     End With  'ScrollBarMasterForm.Label9
  539.     With .Label10
  540.       .Caption = "Value:"
  541.       .Move(300, 5250, 900, 300)
  542.       .Alignment = "Right"
  543.     End With  'ScrollBarMasterForm.Label10
  544.     With .sbrHue
  545.       .Caption = "sbrHue"
  546.       .Move(1500, 4350, 2100, 300)
  547.       .SmallChange = 1
  548.       .LargeChange = 20
  549.       .Max = 360
  550.       .Orientation = "Horizontal"
  551.       .Move(1500, 4350, 2100, 300)
  552.     End With  'ScrollBarMasterForm.sbrHue
  553.     With .sbrSaturation
  554.       .Caption = "sbrSaturation"
  555.       .Move(1500, 4800, 2100, 300)
  556.       .SmallChange = 1
  557.       .LargeChange = 20
  558.       .Max = 100
  559.       .Orientation = "Horizontal"
  560.       .Move(1500, 4800, 2100, 300)
  561.     End With  'ScrollBarMasterForm.sbrSaturation
  562.     With .sbrValue
  563.       .Caption = "sbrValue"
  564.       .Move(1500, 5250, 2100, 300)
  565.       .SmallChange = 1
  566.       .LargeChange = 20
  567.       .Max = 100
  568.       .Orientation = "Horizontal"
  569.       .Move(1500, 5250, 2100, 300)
  570.     End With  'ScrollBarMasterForm.sbrValue
  571.     With .lblHue
  572.       .Caption = "0"
  573.       .Move(3900, 4350, 435, 300)
  574.     End With  'ScrollBarMasterForm.lblHue
  575.     With .lblSaturation
  576.       .Caption = "0"
  577.       .Move(3900, 4800, 435, 300)
  578.     End With  'ScrollBarMasterForm.lblSaturation
  579.     With .lblValue
  580.       .Caption = "0"
  581.       .Move(3900, 5250, 435, 300)
  582.     End With  'ScrollBarMasterForm.lblValue
  583.     With .Label7
  584.       .Caption = "3. Enter a Color Value in the box and click Convert button."
  585.       .ForeColor = 13107200
  586.       .Move(300, 5850, 5700, 300)
  587.     End With  'ScrollBarMasterForm.Label7
  588.     With .txtColorValue
  589.       .Move(2250, 6300, 1350, 330)
  590.     End With  'ScrollBarMasterForm.txtColorValue
  591.     With .Label11
  592.       .Caption = "Decimal Value:"
  593.       .Move(600, 6300, 1500, 300)
  594.     End With  'ScrollBarMasterForm.Label11
  595.     With .cmdConvert
  596.       .Caption = "Convert"
  597.       .Move(4800, 7050, 1200, 450)
  598.     End With  'ScrollBarMasterForm.cmdConvert
  599.     With .Label12
  600.       .Caption = "RED"
  601.       .ForeColor = 255
  602.       .Move(600, 6900, 600, 300)
  603.     End With  'ScrollBarMasterForm.Label12
  604.     With .Label13
  605.       .Caption = "GREEN"
  606.       .ForeColor = 38400
  607.       .Move(1650, 6900, 900, 300)
  608.     End With  'ScrollBarMasterForm.Label13
  609.     With .lblGreenValue
  610.       .BackColor = 16777215
  611.       .Move(1650, 7200, 750, 300)
  612.       .BorderStyle = "Fixed Single"
  613.     End With  'ScrollBarMasterForm.lblGreenValue
  614.     With .lblRedValue
  615.       .BackColor = 16777215
  616.       .Move(600, 7200, 750, 300)
  617.       .BorderStyle = "Fixed Single"
  618.     End With  'ScrollBarMasterForm.lblRedValue
  619.     With .Label15
  620.       .Caption = "BLUE"
  621.       .ForeColor = 9830400
  622.       .Move(2850, 6900, 750, 300)
  623.     End With  'ScrollBarMasterForm.Label15
  624.     With .lblBlueValue
  625.       .BackColor = 16777215
  626.       .Move(2850, 7200, 750, 300)
  627.       .BorderStyle = "Fixed Single"
  628.     End With  'ScrollBarMasterForm.lblBlueValue
  629.     With .helpfile
  630.       .FileName = "W:\Examples\scrolbar\scrolbar.hlp"
  631.     End With  'ScrollBarMasterForm.helpfile
  632.     .Caption = "ScrollBar Demonstration"
  633.     .Move(4080, 1815, 6420, 8490)
  634.     .ChangeFlag = 1
  635.     .GotFocusFlag = 1
  636.     .RED = 0
  637.     .GREEN = 0
  638.     .BLUE = 0
  639.     .HUE = 0
  640.     .SATURATION = 0
  641.     .VALUE = 0
  642.     .LoopBack = 0
  643.     .SampleDir = "W:\Examples\scrolbar\"
  644.     .SampleName = "scrolbar"
  645.   End With  'ScrollBarMasterForm
  646. End Code
  647.