VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to add Flat Scroll Bars to a ListView control (VB5) - requires version 4.71 of comctl32.dll or

by Chris Eastwood (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 23rd February 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to add Flat Scroll Bars to a ListView control (VB5) - requires version 4.71 of comctl32.dll or later (IE4 or IE4.1)

API Declarations


Private Const LVM_SETEXTENDEDLISTVIEWSTYLE As Long = (LVM_FIRST + 54)
Private Const LVS_EX_FLATSB As Long = &H100

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long


Rate How to add Flat Scroll Bars to a ListView control (VB5) - requires version 4.71 of comctl32.dll or



 It doesnt Have to be in Form_Load obviously

Private Sub Form_Load()

  Dim lCount As Long

  ListView1.ColumnHeaders.Add , , "Column 1"
  ListView1.ColumnHeaders.Add , , "Column 2"
  ListView1.View = lvwReport

 Add some items to the listview
  
  With ListView1.ListItems     
    For lCount = 1 To 25
      .Add , , "Listview item number " & lCount     
    Next
  End With

 Set the Flat ScrollBar Style on the ListView
  
  SendMessage ListView1.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_FLATSB, True

End Sub

Regards

Chris Eastwood

CodeGuru - the website for developers
http://www.codeguru.com/vb

Download this snippet    Add to My Saved Code

How to add Flat Scroll Bars to a ListView control (VB5) - requires version 4.71 of comctl32.dll or Comments

No comments have been posted about How to add Flat Scroll Bars to a ListView control (VB5) - requires version 4.71 of comctl32.dll or . Why not be the first to post a comment about How to add Flat Scroll Bars to a ListView control (VB5) - requires version 4.71 of comctl32.dll or .

Post your comment

Subject:
Message:
0/1000 characters