Jul 16th, 2006, 07:59 PM
#1
Thread Starter
Addicted Member
[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
Jul 16th, 2006, 08:08 PM
#2
Re: Help with ShowScrollBar API
well there are couple of approaches - what exactly are you trying to do
Jul 16th, 2006, 10:48 PM
#3
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
Jul 17th, 2006, 05:38 PM
#4
Thread Starter
Addicted Member
Re: Help with ShowScrollBar API
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
Originally Posted by
moeur
I will try it thanks
Jul 19th, 2006, 06:40 PM
#5
Thread Starter
Addicted Member
Re: Help with ShowScrollBar API
Sorry but I still need some help as I couldn't understand that topic at MSDN
Jul 19th, 2006, 07:18 PM
#6
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
Attached Files
Jul 23rd, 2006, 08:45 PM
#7
Thread Starter
Addicted Member
Re: [RESOLVED] Help with ShowScrollBar API
Thank you for help , but plz can anybody send me links for subclassing tutorial
Jan 2nd, 2022, 11:19 PM
#8
Addicted Member
Re: Help with ShowScrollBar API
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 .
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width