By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,255 Members | 2,640 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,255 IT Pros & Developers. It's quick & easy.

Draging Images or Controls...

Ali Rizwan
100+
P: 927
Hi all,
I have a small problem. How can i drag controls in a form?
I want to do same as in explorer that we can drag any icon or folder anywhere in the window..

Thanx
>> ALI <<
May 9 '08 #1
Share this Question
Share on Google+
6 Replies


lotus18
100+
P: 866
Hi Ali

What kind of control? How about Drag and Drop Method?

Rey Sean
May 10 '08 #2

Ali Rizwan
100+
P: 927
Hi Ali

What kind of control? How about Drag and Drop Method?

Rey Sean
Thanx for replying.
As you have experienced on your desktop that you can drag any icon any where on the desktop. I want to do same as that but with my image controls and label controls.

Thanx
>> ALI <<
May 10 '08 #3

daniel aristidou
100+
P: 491
Thanx for replying.
As you have experienced on your desktop that you can drag any icon any where on the desktop. I want to do same as that but with my image controls and label controls.

Thanx
>> ALI <<
hi ali....is this in vb6?
Jun 2 '08 #4

jamesd0142
100+
P: 469
Its messy but here what i did for something simular...

to move a label:
1. add a timer to your form (intervals 10)
2. on the label mouse down event, start timer
3. on the mouse up event stop timer.

Timer code: (something like):
label1.top = mouse position x
label1.left = mouse position y

I can remember exaclty how the code went, but im sure you get my idea?

edit: i found this which should help Windows.Forms.Cursor.Position.Y (vb2005)

James
Jun 2 '08 #5

Ali Rizwan
100+
P: 927
hi ali....is this in vb6?
Yes this is in vb6.

Thanx
>> ALI <<
Jun 3 '08 #6

Ali Rizwan
100+
P: 927
Its messy but here what i did for something simular...

to move a label:
1. add a timer to your form (intervals 10)
2. on the label mouse down event, start timer
3. on the mouse up event stop timer.

Timer code: (something like):
label1.top = mouse position x
label1.left = mouse position y

I can remember exaclty how the code went, but im sure you get my idea?

edit: i found this which should help Windows.Forms.Cursor.Position.Y (vb2005)

James
Ok
By the way i have made my code for dragging. That was not different than yours but in vb6 nstead of mouse position.... i write x and y only.

Thanx
>> ALI <<
Jun 3 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.