Private Declare Function TranslateColor Lib "olepro32.dll" Alias "OleTranslateColor" (ByVal clr As OLE_COLOR, ByVal palet As Long, Col As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function FrameRect Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
'draw by pixel or by line
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function SetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
'select and delete created objects
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
'create regions of pixels and remove them to make the control transparent
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Const RGN_DIFF As Long = 4
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
x As Long
y As Long
End Type
Private Const m_def_ValueVis = True
Private Const m_def_ValueCol = vbBlack
Private Const m_def_ButtonStyle = 0
Private Const m_def_ArrowStyle = 1
Private m_ArrowStyle As Integer
Private m_ButtonStyle As Integer
Private m_ValueVis As Boolean
Private m_ValueCol As OLE_COLOR
Private rc As RECT
Private W As Long, H As Long
Private regMain As Long, rgn1 As Long
Private R As Long, l As Long, t As Long, B As Long
Private Sub UserControl_Initialize()
m_ValueVis = m_def_ValueVis
m_ValueCol = m_def_ValueCol
m_ButtonStyle = m_def_ButtonStyle
m_ArrowStyle = m_def_ArrowStyle
End Sub
Private Sub UserControl_InitProperties()
mMin = 0
mMax = 100
mValue = 0
mSliderWH = 400
mBarBaseCol = vbBlue
mBarMidCol = &HFFFFFE
PosSlider
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)