473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

how can i drag/drop a label with the use of an image.

neit
2
hi every one, i'm new at this things in programing (visual basic 6.0).

And i was wondering if i can make an image grab or attach a label to move it around and place it in another place, with the use of an image, i've tried with the mouse drag/drop and works fine. thanks in advance =).
Apr 4 '07 #1
9 4161
Dököll
2,364 Expert 2GB
hi every one, i'm new at this things in programing (visual basic 6.0).

And i was wondering if i can make an image grab or attach a label to move it around and place it in another place, with the use of an image, i've tried with the mouse drag/drop and works fine. thanks in advance =).
Hello, neit!

Are you hoping to move labels or snapshots at run time? If so, I am not certain, but it does not seem to be possible. Even though a programmer does not lock the controls, at run time, VB keep us from moving stuff around. That's what I think is happening.

If you are hoping to move labels or snapsots in design mode, just make sure your controls are not locked:

(1) Go to Format, with your form showing
(2) Choose Lock Controls

Note: If button is in Form is therefore locked.

Have fun and welcome!

Dököll
Apr 5 '07 #2
Killer42
8,435 Expert 8TB
hi every one, i'm new at this things in programing (visual basic 6.0).

And i was wondering if i can make an image grab or attach a label to move it around and place it in another place, with the use of an image, i've tried with the mouse drag/drop and works fine. thanks in advance =).
I'm afraid it is not really clear just what you want to achieve, though it's obviously related to drag and drop. Please try to explain a little more clearly, for those of us who are a bit slow. :)

(Have you checked out the DragIcon property?)
Apr 5 '07 #3
Dököll
2,364 Expert 2GB
This just in. I snooped around and found vbBeginDrag perhaps this can get you started. Starts up straight away though, perhaps you should look into DragIcon examples...
Apr 14 '07 #4
iburyak
1,017 Expert 512MB
Hello, neit!

Are you hoping to move labels or snapshots at run time? If so, I am not certain, but it does not seem to be possible. Even though a programmer does not lock the controls, at run time, VB keep us from moving stuff around. That's what I think is happening.

If you are hoping to move labels or snapsots in design mode, just make sure your controls are not locked:

(1) Go to Format, with your form showing
(2) Choose Lock Controls

Note: If button is in Form is therefore locked.

Have fun and welcome!

Dököll
To move Label-control around a form with your mouse try this:

1. Put Label on a form.
2. Paste code below and run your project.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2.     If Button = vbLeftButton Then
  3.         Label1.Left = Label1.Left + X
  4.         Label1.Top = Label1.Top + Y
  5.     End If
  6. End Sub
3. Try to move label with your mouse.

Good Luck.
Apr 15 '07 #5
Killer42
8,435 Expert 8TB
I believe the original question was not so much about dragging, as the use (in some way) of an image.
Apr 15 '07 #6
iburyak
1,017 Expert 512MB
I believe the original question was not so much about dragging, as the use (in some way) of an image.
The answer was not to original question..... :)

DragIcon property is a correct answer.... LOL
Apr 15 '07 #7
Killer42
8,435 Expert 8TB
The answer was not to original question..... :)

DragIcon property is a correct answer.... LOL
Perhaps. We won't know whether it's the correct answer unless neit privdes us some feedback.

Hello, Earth to neit...
Apr 15 '07 #8
neit
2
Thanks every one for your your replies, but as you know i am a piece of amateur in VB programing, thanks everyone =)

how can i insert an image, so you can see my proyect form? please tell me

The thing that i need, better i should say; the thing i want to do in my proyect is: with the use of an image to be able to "grab" a label, and place it in another label, so i can get the value of the label (right now i'm using "val()" ); i can drag/drop the label into another label by using the property "dragmode-->automatic" with the mouse and with the code
Expand|Select|Wrap|Line Numbers
  1. 'example
  2. label4.caption=source
  3.  
that way i can get the value of the other label, but because of my lack of knowledge i can't do it the way i want using an image as some kind of " human hand taking a box and place it somewhere else"

i hope you understand me O_o =( thanks everyone
Apr 16 '07 #9
iburyak
1,017 Expert 512MB
Look how to do it in VB6. Just change Text1.DragIcon property to some *.ico file you like.

http://msdn2.microsoft.com/en-us/library/xz32ty04(VS.80).aspx

I am not sure thou if you can do the same with a label.
Label doesn’t have interactive interface and doesn’t have OleDropeMode Automatic.
To work around it you can make TextBox look like a label.

Try this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Text1.Appearance = 0
  3. Text1.Locked = True
  4. Text1.BorderStyle = 0
  5. Text1.BackColor = Me.BackColor
  6. Text1.TabStop = False
  7. End Sub
  8.  
  9.  
  10.  
  11. Private Sub Text1_GotFocus()
  12. Text2.SetFocus
  13. End Sub
Good Luck.
Apr 16 '07 #10

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

Similar topics

2
by: yihan | last post by:
Hi, I made a program to drag and drop the image using mouseevent, it only works on IE well, not on Netscape. Does anyone has the example suitable for Netscape? Please help. Thank you very much. ...
2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
1
by: Kevin L | last post by:
I have a Panel control that I currently allow the user to drag and reposition on a form at runtime. This Panel control contains a Label control. I would like to allow the user to drag the PANEL...
1
by: Brad | last post by:
Okay, I am learning about Drag/Drop operations so I am green when it comes to this. I have a form that draws several optional labels that are single-bordered. I also have a dozen colored labels...
0
by: pamelafluente | last post by:
Hi, I have a PictureBox on a form. I wish to drag the image exposed by the PictureBox through the property "image" to a window of Windows Explorer. The new file will have a name assigned by the...
1
by: Dawoodmm | last post by:
Hi i have a sight problem with detecting the mouse up in a drag-drop outside a form what i have on my hands is an mdi form with 2 child forms: form1 and form2, both containing a label each. i also...
0
by: arvinds | last post by:
I have an application in which I have 2 forms. 1.Review Form 2. FilmForm. Review Form is used for Loading some images and we can transfer the Images from Review From to FilmForm by Drag-Drop...
4
by: Jeff | last post by:
Hello, I am trying to drag and drop a label control from one cell in a tablelayoutpanel to another (VB2005). There is no problem if both cells are visible, but i cannot get the tablelayoutpanel...
1
by: GriffinWolf | last post by:
Hi, I am using VB6 for a school project. In my program, certain objects (currently Image boxes) need to be dragged to other areas of the screen. If they are placed over another image, they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.