VB Snippet - Change color of scrollbar
VB Code:
Option Explicit
Dim WithEvents vbLink As EventVB.APIFunctions
Dim WithEvents vbWnd As EventVB.ApiWindow
Private Sub Form_Load()
Set vbLink = New APIFunctions
Set vbWnd = New ApiWindow
vbWnd.hWnd = Me.hWnd
vbLink.SubclassedWindows.Add vbWnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
vbLink.SubclassedWindows.Remove vbWnd
End Sub
Private Sub vbWnd_ControlColour(ByVal ControlType As EventVB.StandardControlTypes, ByVal DeviceContext As EventVB.ApiDeviceContext, ByVal ControlWindow As EventVB.ApiWindow, ColourBrush As EventVB.ApiLogBrush)
Dim colThis As ApiColour
Set colThis = New ApiColour
With colThis
.Blue = 255
.Green = 0
.Red = 0
End With
If ControlType = Control_Scrollbar Then
Set ColourBrush.Colour = colThis
End If
End Sub
Re: VB Snippet - Change color of scrollbar
Quote:
Originally Posted by
James Stanich
VB Code:
Option Explicit
Dim WithEvents vbLink As EventVB.APIFunctions
Dim WithEvents vbWnd As EventVB.ApiWindow
Private Sub Form_Load()
Set vbLink = New APIFunctions
Set vbWnd = New ApiWindow
vbWnd.hWnd = Me.hWnd
vbLink.SubclassedWindows.Add vbWnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
vbLink.SubclassedWindows.Remove vbWnd
End Sub
Private Sub vbWnd_ControlColour(ByVal ControlType As EventVB.StandardControlTypes, ByVal DeviceContext As EventVB.ApiDeviceContext, ByVal ControlWindow As EventVB.ApiWindow, ColourBrush As EventVB.ApiLogBrush)
Dim colThis As ApiColour
Set colThis = New ApiColour
With colThis
.Blue = 255
.Green = 0
.Red = 0
End With
If ControlType = Control_Scrollbar Then
Set ColourBrush.Colour = colThis
End If
End Sub
can u explain about
Dim WithEvents vbLink As EventVB.APIFunctions
Dim WithEvents vbWnd As EventVB.ApiWindow
it doesn't contain that file...!!!