[RESOLVED] Help with ShowScrollBar API
I can give a control scrollbars by this API , but how can I give them code , I mean how can I make them scroll something???????
VB Code:
Private Declare Function ShowScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wBar As Long, ByVal bShow As Long) As Long
Private Const SB_HORZ = 0
Private Const SB_VERT = 1
Private Const SB_BOTH = 3
Private Sub Form_Load()
ShowScrollBar Text1.hwnd, SB_BOTH, True
End Sub
Re: Help with ShowScrollBar API
well there are couple of approaches - what exactly are you trying to do
Re: Help with ShowScrollBar API
You will have to subclass your textbox and process WM_HSCROLL and WM_VSCROLL messages.
http://msdn.microsoft.com/library/de...scrollbars.asp
Re: Help with ShowScrollBar API
Quote:
Originally Posted by bushmobile
well there are couple of approaches - what exactly are you trying to do
I want to scroll a picbox (or any container) not a textbox actually , I just copied
the code from API Guide
Quote:
Originally Posted by moeur
I will try it thanks
Re: Help with ShowScrollBar API
Sorry but I still need some help as I couldn't understand that topic at MSDN
1 Attachment(s)
Re: Help with ShowScrollBar API
Here is an example of how to do it for the vertical scrollbar and a picturebox
You'll have to add code for the horizontal.
You'll also have to add code to move the picture once the scrollbar position has been changed
Re: [RESOLVED] Help with ShowScrollBar API
Thank you for help , but plz can anybody send me links for subclassing tutorial
Re: Help with ShowScrollBar API
Quote:
Originally Posted by
moeur
Here is an example of how to do it for the vertical scrollbar and a picturebox
You'll have to add code for the horizontal.
You'll also have to add code to move the picture once the scrollbar position has been changed
January 2022: Proof that old threads can still be relevant - This may not have helped the OP back in 2006 but it sure helped to solve one of my problems today :).