vbAccelerator - Contents of code file: frmHexColorPicker.frm

VERSION 5.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   Caption         =   "Form1"
   ClientHeight    =   4965
   ClientLeft      =   2835
   ClientTop       =   1950
   ClientWidth     =   6585
   LinkTopic       =   "Form1"
   ScaleHeight     =   331
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   439
   Begin VB.VScrollBar VScroll2 
      Height          =   2775
      LargeChange     =   32
      Left            =   3540
      Max             =   128
      SmallChange     =   8
      TabIndex        =   1
      Top             =   240
      Value           =   64
      Width           =   195
   End
   Begin VB.VScrollBar VScroll1 
      Height          =   2775
      LargeChange     =   32
      Left            =   3300
      Max             =   255
      SmallChange     =   8
      TabIndex        =   0
      Top             =   240
      Value           =   1
      Width           =   195
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_c As New cHexColourPicker

Private Sub DrawPicker()
Dim S As Single
Dim L As Single
   L = (128 - VScroll2.Value) / 128
   S = (255 - VScroll1.Value) / 255
   Me.Cls
   m_c.DrawPicker Me.hdc, 32, 32, , S, L
   Me.Refresh
End Sub

Private Sub Form_Load()
   m_c.Create 102
   DrawPicker
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y
 As Single)
Dim i As Long
   If (Button = vbLeftButton) Then
      i = m_c.HitTest(X, Y)
      If (i > 0) Then
         m_c.Selected = i
         DrawPicker
      End If
   End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y
 As Single)
Dim i As Long
   If (Button = vbLeftButton) Then
      i = m_c.HitTest(X, Y)
      If (i > 0) Then
         m_c.Selected = i
         DrawPicker
      End If
   End If
End Sub

Private Sub VScroll1_Change()
   DrawPicker
End Sub

Private Sub VScroll1_Scroll()
   DrawPicker
End Sub

Private Sub VScroll2_Change()
   DrawPicker
End Sub

Private Sub VScroll2_Scroll()
   DrawPicker
End Sub