|
-
September 18th, 2001, 07:30 PM
#1
Using scrollbars.. Please help!
Can someone help me with the code to use scrollbars? I'm having a picturebox in a frame
which I need to move using the scrollbars.
Urgent. Please help.
Suresh.
-
September 19th, 2001, 03:28 PM
#2
Re: Using scrollbars.. Please help!
To move the picturebox itself , which is what you are trying to do i believe, place horisontal and vertical scrollbars in the frame , extend them to the frame extends, use the scroll bars scange event, and assign the picturebox "TOP" or "LEFT" property to the ScrollBar "VALUE" property. Look at the picture moves!
Hope it helps.
-
September 19th, 2001, 03:46 PM
#3
Re: Using scrollbars.. Please help!
On a form put a frame and on the frame put a picturebox and a vert. scroll bar and try this code...
private Sub Form_Load()
'no border on frame
Frame1.BorderStyle = 0
'set pictbox coords in frame...
Picture1.Top = Frame1.Top
Picture1.Left = Frame1.Left
Picture1.Picture = LoadPicture("Picturename.bmp")
Picture1.Height = Picture1.Image.Height
VScroll1.Min = 1
VScroll1.Max = 100
End Sub
private Sub VScroll1_Change()
Dim sPctNum as Single
sPctNum = (Picture1.Height - Frame1.Height) * (VScroll1.Value / 100)
Picture1.Top = -sPctNum
End Sub
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
|