How to force list control always have scroll bar?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there simple way to force list control always have scroll bar, even if the
list control is not full?

Thanks
 
Hi Steeve!

you can call the ShowScrollBar API :
'***
Private Const SB_HORZ As Int32 = 0
Private Const SB_VERT As Int32 = 1
Private Const SB_CTL As Int32 = 2
Private Const SB_BOTH As Int32 = 3

'BOOL ShowScrollBar(
' HWND hWnd,
' int wBar,
' BOOL(bShow)
<DllImport("user32.dll")> _
Private Shared Function ShowScrollBar _
( _
ByVal hWnd As IntPtr, _
ByVal wBar As Int32, _
ByVal bShow As Boolean) As Boolean
'
End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' show the both scrollbar
ShowScrollBar(ListBox1.Handle, SB_BOTH, True)
End Sub
'***
 
dooo! wrong group...

the technic should work in C++ though... I just got no idea about the syntax
you have too use.
 
Back
Top