Results 1 to 2 of 2

Thread: VB Snippet - Change color of scrollbar

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    VB Snippet - Change color of scrollbar

    VB Code:
    1. Option Explicit
    2.  
    3. Dim WithEvents vbLink As EventVB.APIFunctions
    4. Dim WithEvents vbWnd As EventVB.ApiWindow
    5.  
    6. Private Sub Form_Load()
    7.  
    8. Set vbLink = New APIFunctions
    9.  
    10. Set vbWnd = New ApiWindow
    11. vbWnd.hWnd = Me.hWnd
    12.  
    13. vbLink.SubclassedWindows.Add vbWnd
    14.  
    15. End Sub
    16.  
    17. Private Sub Form_Unload(Cancel As Integer)
    18.  
    19. vbLink.SubclassedWindows.Remove vbWnd
    20.  
    21. End Sub
    22.  
    23. Private Sub vbWnd_ControlColour(ByVal ControlType As EventVB.StandardControlTypes, ByVal DeviceContext As EventVB.ApiDeviceContext, ByVal ControlWindow As EventVB.ApiWindow, ColourBrush As EventVB.ApiLogBrush)
    24.  
    25. Dim colThis As ApiColour
    26.  
    27. Set colThis = New ApiColour
    28. With colThis
    29.     .Blue = 255
    30.     .Green = 0
    31.     .Red = 0
    32. End With
    33.  
    34. If ControlType = Control_Scrollbar Then
    35.     Set ColourBrush.Colour = colThis
    36. End If
    37.  
    38. End Sub
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  2. #2
    New Member Bayu Malmsteen's Avatar
    Join Date
    Apr 2010
    Location
    Bandung, Indonesia
    Posts
    14

    Re: VB Snippet - Change color of scrollbar

    Quote Originally Posted by James Stanich View Post
    VB Code:
    1. Option Explicit
    2.  
    3. Dim WithEvents vbLink As EventVB.APIFunctions
    4. Dim WithEvents vbWnd As EventVB.ApiWindow
    5.  
    6. Private Sub Form_Load()
    7.  
    8. Set vbLink = New APIFunctions
    9.  
    10. Set vbWnd = New ApiWindow
    11. vbWnd.hWnd = Me.hWnd
    12.  
    13. vbLink.SubclassedWindows.Add vbWnd
    14.  
    15. End Sub
    16.  
    17. Private Sub Form_Unload(Cancel As Integer)
    18.  
    19. vbLink.SubclassedWindows.Remove vbWnd
    20.  
    21. End Sub
    22.  
    23. Private Sub vbWnd_ControlColour(ByVal ControlType As EventVB.StandardControlTypes, ByVal DeviceContext As EventVB.ApiDeviceContext, ByVal ControlWindow As EventVB.ApiWindow, ColourBrush As EventVB.ApiLogBrush)
    24.  
    25. Dim colThis As ApiColour
    26.  
    27. Set colThis = New ApiColour
    28. With colThis
    29.     .Blue = 255
    30.     .Green = 0
    31.     .Red = 0
    32. End With
    33.  
    34. If ControlType = Control_Scrollbar Then
    35.     Set ColourBrush.Colour = colThis
    36. End If
    37.  
    38. End Sub
    can u explain about
    Dim WithEvents vbLink As EventVB.APIFunctions
    Dim WithEvents vbWnd As EventVB.ApiWindow
    it doesn't contain that file...!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width