有的时候我的colunm只有一个,却出现了水平拖动条,很难看。.

解决方案 »

  1.   

    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Const GWL_STYLE = (-16)
    Dim Style As Long
     Style = GetWindowLong(ListView1.hwnd, GWL_STYLE)
     Style = Style Or 3
     SetWindowLong ListView1.hwnd, GWL_STYLE, Style
      

  2.   

    Option Explicit
    Private Declare Function EnableScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wSBflags As Long, ByVal wArrows As Long) As Long
    Private Const SB_HORZ = 0
    Private Const ESB_DISABLE_BOTH = &H3
    Private Sub Command1_Click()EnableScrollBar ListView1.hwnd, SB_HORZ, ESB_DISABLE_BOTHEnd Sub