|
-
Sep 30th, 2000, 11:58 PM
#1
Thread Starter
New Member
I've seen a lot of samples here regarding the scrolling of items that are in a fixed position relative to each other. I was wondering if anyone has any code samples for implementing a combination of dragging items and scrolling.
Thanks
-
Oct 1st, 2000, 12:09 AM
#2
Do you mean dragging and moving items around?
Code:
Dim oldX As Long, oldY As Long, isMoving As Boolean
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
oldX = X
oldY = Y
isMoving = True
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If isMoving Then
Image1.Top = Image1.Top - (oldY - Y)
Image1.Left = Image1.Left - (oldX - X)
End If
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
isMoving = False
End Sub
It can basically move almost everything.
-
Oct 1st, 2000, 12:18 AM
#3
Thread Starter
New Member
Thanks Matthew.... I understand how to move the items themselves but its the interaction with the scrolbar that I'm having difficulty with. For example, when I drag an item to the bottom of the window I basically want the virtual to "grow" and be reflected by the scrollbar. Also need some help in correlating how to display the contents of the window based on the value of the scrollbar.
-
Oct 1st, 2000, 12:24 AM
#4
Here is the thread to an example of how to make a scrollable form. I am sure you will be able to make the scrollbar visible and not visible when you detect an object that is not on in your form's width/height areas.
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
|