Want To Drag And Drop A Image Onto Another Question
I am using VB 6.0 I wanted to learn how to move pictures on a form ontop of other images. Right now I can click on image1 and drag and drop it where ever I want. I put another image on the form and I wanted to drag image 1 overtop of image 2 and drop image 1 on 2, so that only the top half of image 2 was showing.
Upon doing so, I could not get the image to drop over any of the space image2 is using on the form. The best I can do is just drop image 1 beside image 2. Any sites or help would be greately appreciated!
my code: Code: 'General Dim dx As Single, dy As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single) Source.Move X! - dx!, Y! - dy! End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) dx! = X!: dy! = Y! Image1.Drag End Sub
epatterson78
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drag/Drop Of A PictureBox, Keeping The Image Visible During Drag
Haya!
As the title says, I need to do what seems to me should be fairly simple. I have a number of pictureboxes each filled with a static image. I would like to add the ability for a user to drag the picturebox on to ANOTHER picturebox (this one holds a image currently selected by dropdown list). Upon drop, the box and associated dropdown box should be changed accordingly.
I only need a single integer to transfer with the drag/drop operation, as each image is keyed to a number.
Now, I am not all that familier with Drag Drop at all, much less with maintaining the image while being dragged... If anyone could point me to a good tutorial, I would be much appreciative.
Thanks!
Dave Borneman
Need Help With Image Drag And Drop
I've got an picturebox with an image in it, another set of command buttons which change the mouse icon, so I can add different icons onto my image. What I want to be able to do is click the command button, then place an icon on the image, and save the image so the new image includes the base image, plus the icon added to it.
I guess I could create an icon on top of the image, then store the x/y coordinates and then when I re-loaded the image, the application would have to re-load the image and subsequent icons, but that's no good for printing.
This is a business application for the layout of concert events. The command buttons are things like security, bathrooms, monitors, mixer board, lights, and the base image is the venue layout. So if you need to mock up what it's gonna take to play different venues, you'd need to place all these icons onto the base "map".
Thanks
SAP220
Image Drag && Drop Q:
Hello all,
In my app, I've got a small gif inside of a small image control (LightWhite). I also have a large picture control (Client) with a loaded picture as a "background. What I would like to do is drag a copy of the small gif and drop it on top of the picture control. Any thoughts would be great.
VB Code:
Public IndicatorX As SinglePublic IndicatorY As SinglePrivate newIndex As Integer Private Sub LightWhite_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)If Button = vbLeftButton Then LightWhite(Index).OLEDrag End IfEnd Sub Private Sub LightWhite_OLEStartDrag(Index As Integer, Data As DataObject, AllowedEffects As Long) Data.SetData LightWhite(Index).Picture, vbCFBitmap AllowedEffects = vbDropEffectCopyEnd Sub Private Sub Client_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)newIndex = LightWhite.Count + 1 Load LightWhite(newIndex) LightWhite(newIndex).Picture = Data.GetData(vbCFBitmap) IndicatorX = Client.Left + X IndicatorY = Client.Left + Y LightWhite(newIndex).Left = Client.Left + X LightWhite(newIndex).Top = Client.Top + Y LightWhite(newIndex).Visible = True LightWhite(newIndex).ZOrder 0End Sub
Thanks for any thoughts.
PS. This code works, but I'll be damned if I can get the gif to show up in the client! Argggg!
Image Drag Drop ???
i am trying to drag and drop images around a form but its not going to plan
if there is more then 1 image on the form at any one time and i click one to drag and then drop it else where on the form as soon as i let go of the mouse click (mouse_up) both pictures move to that location on the form my code is as follows:
VB Code:
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single) imgArlene.Move X, Y imgBooker.Move X, Y End Sub
in total there are 11 images i would like to move around the form individuatly
Thanks in advance .....RedAngel
Drag && Drop Image
How can i drag an image and drop it into a button or a label?
I wanna make a sea-battle/submarines game.
and i want the player to be able to put his ships where ever he wants, so how can i drag and drop for exmaple an image which is bigger then the label/button?
tnx
Drag And Drop Image
I am dragging and dropping one image, over another image.
I use my mousedown event to pick up the image2, dragover event to drag image2 over the image1, and i try and use dragdrop to drop my image2 on image1. However, when I drop the image I cannot see it. How can I drag and drop one image on another and see the second image on the first. I am using picture boxes. My code is as follows:
Dim dragx As Single
Dim dragy As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move (X - dragx), (Y - dragy)
End Sub
Private Sub Picture2_DragDrop(Source As Control, X As Single, Y As Single)
Source.Drag vbEndDrag
Source.Move (X - dragx), (Y - dragy)
Refresh
End Sub
Private Sub Picture2_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
Select Case State
Case 0:
Picture1.DragIcon = LoadPicture(App.Path & "imgicon.ico")
Case 1:
Picture1.DragIcon = LoadPicture(App.Path & "imgicon.ico")
End Select
End Sub
Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.DragIcon = LoadPicture(App.Path & "imgicon.ico")
dragx = X
dragy = Y
Picture2.Drag vbBeginDrag
End Sub
Any ideas?
Image Drag And Drop
How can I do this?:
create a GUI in order a specific user of internet explorer to be able to drag and drop some icons from a control panel over a specific image and the final image to be sent back to the web server for publish.
Do I have to make VB EXE and send the result with FTP? Or maybe an active-x? or a html with script for drag and drop? what is easier?
Michael Vlastos
Automation Engineer
Intracom, Research & Development Division
Development Programmes Department
Athens, Greece
Image Drag-n-drop To Another Picturebox
Hello all,
I know cross-posting is a sin but, this board is way more informative! Anyhow, here goes....
In my app, I've got a small gif inside of a small image control (LightWhite). I also have a large picture control (Client) with a loaded picture as a "background. What I would like to do is drag a copy of the small gif and drop it on top of the picture control. Any thoughts would be great.
code:
Public IndicatorX As Single
Public IndicatorY As Single
Private newIndex As Integer
Private Sub LightWhite_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
LightWhite(Index).OLEDrag
End If
End Sub
Private Sub LightWhite_OLEStartDrag(Index As Integer, Data As DataObject, AllowedEffects As Long)
Data.SetData LightWhite(Index).Picture, vbCFBitmap
AllowedEffects = vbDropEffectCopy
End Sub
Private Sub Client_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
newIndex = LightWhite.Count + 1
Load LightWhite(newIndex)
LightWhite(newIndex).Picture = Data.GetData(vbCFBitmap)
IndicatorX = Client.Left + X
IndicatorY = Client.Left + Y
LightWhite(newIndex).Left = Client.Left + X
LightWhite(newIndex).Top = Client.Top + Y
LightWhite(newIndex).Visible = True
LightWhite(newIndex).ZOrder 0
End Sub
Thanks for any thoughts.
PS. This code works, but I can't get the gif to show up in the client! Argggg!
Drag N Drop Filename Image
Hi All...
How do I put the sorta translucent filename when I drag and drop a file on a listview to another listview?
It even includes the icon...
I found this const in sendmessage API but i dunno how to use it and i'm not sure of it anyway.
Public Const LVM_CREATEDRAGIMAGE = (LVM_FIRST + 33)
Best Regards,
zyn
How To Drag N Drop An Image Onto A Form.
I'd like to Drag n Drop an image onto a form - can someone explain how to do this please.
I've tried a combination of Picture Box / Image, and various Propeties setting, but it doesn't seem to work.
Sometimes I get the circle and line through it pointer and others a file shortcut pointer icon when attempting a drop. Whats going on there?
Thanks.
Image Drag N Drop Stuff
'the object of the code below is to be able to drag image1 or image2
'over image 3 and to know when I am over the image, either partial or
'complete. However, it is not working and I need help
'in getting it to tell me when I am over the image3
'also, the image1 or image2, when dropped seem to adjust
'and not drop exactyly where I am hovering.
'MouseUp is doing nothing...dragging is ok...dropping ???
'any help is appreciated...Wayne
'bas module code
Option Explicit
Public globalX As Integer
Public globalY As Integer
Public r1 As RECT
Public r2 As RECT
Public rcDest As RECT
Public lngResult As Long
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Declare Function IntersectRect Lib "user32" _
(lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Long
'form code
Option Explicit
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
' where you want on the form.
Source.Move (X - Source.Width / 2), (Y - Source.Height / 2)
End Sub
Private Sub Image1_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Image1.Drag vbBeginDrag
globalX = X
globalY = Y
End Sub
Private Sub Image2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image2.Drag vbBeginDrag
globalX = X
globalY = Y
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
r1.Left = Image1.Left
r1.Top = Image1.Top
r1.Right = Image1.Left + Image1.Width - 1
r1.Bottom = Image1.Top + Image1.Height - 1
r2.Left = Image3.Left
r2.Top = Image3.Top
r2.Right = Image3.Left + Image3.Width - 1
r2.Bottom = Image3.Top + Image3.Height - 1
lngResult = IntersectRect(rcDest, r1, r2)
If lngResult <> 0 Then
MsgBox "Rectangles overlapped!", vbOKOnly + vbInformation, ""
Else
MsgBox "Rectangles do not overlap!", vbOKOnly + vbInformation, ""
End If
End Sub
Drag And Drop Word Onto Image
Hi,
I want to drag and drop a word onto an image at runtime.
Does anyone know how to do it ?
I've managed to do half do it in so far as the picture knows that the word was dragged on top but visually the word stays where it was on the form. It doesnt follow the mouse pointer. Instead a kind of ghost rectangle goes where the mouse pointer is.
Any help wourl be much appreciated becuase I've spent hours trying.
Thanks.
Edited by - AbbydonKrafts on 3/22/2007 1:54:10 PM
Can Drag-n-drop Show Text As Image?
I've got some code where I allow users to drag-n-drop between listboxes.
Right now, during the drag operation, there's a small grey square attached to the mouse cursor. I'd like to show the actual item being dragged (which is the text from the list box).
Does anyone know if you can show the text of the dragged list item during dragging, instead of an image?
How?
Thanks,
W
The Drag/Drop Event Of An Image Control.
here I am again... seems as though my other thread died, so I am starting this one. In this one, I hope to attract the input of some of you who will walk me through making a for with an image control in it, into which I can drop a person's picture (probably a .jpg file) and then be able to save the image file/info to a database. Anyone willing to help me get started on this?
I sure would appreciate it
Happieman
a.k.a. Bill
Drag And Drop An Image Into A Form's Picture Control
hello you all... how has everyone been? Some of you are familiar with my application system. I showed it to the director, and he requested that I add a small form into which the interviewers can place a small jpeg image of the individual whose record is being filled out at the time. So in other words, they will have a digital camera and its software at the intake desk. While doing the intake, they will snap a picture of the client. Then they will download the image onto the hard rive . Than they will drag and drop that image into the picture control of the form I am asking help with, now. That image will be saved into the db along with all the other info pertaining to that client. Can someone help me get started on this?
I sure would appreciate it
Happieman
a.k.a. Bill
Edited by - Happieman on 7/7/2005 7:51:02 AM
OLE Drag && Drop (Drag From My App To Windows Explorer)
How can I set this up:
My app will display a listview in large- or small- icon format. These icons will represent files. I would like the user to be able to drag one or more of the icons from the listview and drop them into an Explorer folder (effectively, my app would be copying these files to the desired folder). I know it's probably not rocket science, but I haven't done this before. TIA for your help...
WebBrowser Drag && Drop (get Drop Filename)?
I have Form with 2 WebBrowser's ( WebBrowser1 & WebBrowser2 )
WebBrowser1 is displaying graphic images that can be dragged and dropped into WebBrowser2 but how do I find the name of the file I dragged and dropped?
I also have another related questions.
I can select multiple images in WebBrowser1 but I cannot drop them into WebBrowser2 (only one image at a time), what type of container should I use to drop multiple images into? I know it can be done because I can drag and drop the multiple images into FrontPage.
Your cryptic clues would be enormously helpful to me
Drag && Drop (without Drag!!)
Hello everybody,
Hope there is a geniues or two out there!
I can make drag & drop, from vb6, but i want to make the same
functioin without drag & drop,
I want trough code to drop a picture on a other program, the program is
designed to use drag & drop, so i ques it must be possible to do that, without use of the mouse!
Know that sounds weard, but i need that function to complete a exthange between two programs, in a handicap program.
Best regards
Kim Holzmann
Drag And Drop
Hi,
I have a picture box in my form. What i want is the user to be able to drag and drop mp3 files in that picture box from windows explorer. Once the user drops the mp3 file in that picture box I want to read the full path of that mp3 file (its original location from where it was dragged and dropped). Thanks in advance. i really need to know how to do this and any help appreciated a lot. If anyone can give me the source code that will be great!!!!
Thanks
No Drag Drop
This should be simple enough. Is there a way to disable the drag drop feature of a listview?
Some relevant settings are currently set to...
DragMode = vbManual
OLEDragMode = ccOLEDragManual
OLEDropMode = ccOLEDropManual
View = lvwIcon
I simply don't want the user dragging the images anywhere.
Edit: Nevermind, got it, sorry thanks.
OLEDragMode = ccOLEDragAutomatic
OLEDropMode = ccOLEDropNone
Drag And Drop...do I Use?
Ok I have set a command button to drag(automatic)
so i click on the button and i get an outline of the button
which means i am dragging it.
My problem is when i drop it, it disapears. I want to make it so i can drag my command button and then drop it on the form.
Can you give me a very straight forward example? thanx
Drag And Drop HELP
Hi guys,
I have been trying to get a drag and drop of 4 pictureboxes going for weeks now and without success. I have come across IcePlug tutorial about the subject which is excellent and thumbs up for these people. I have managed to modify it to get what I need. I am posting my code here.
What I need is a simple 2 pairs of picture to drag and drop. Then with a button control I check if the right pic is dropped on the right drop pic.
Yet with my lack of experience in vb.NET I cannot get it right.
Can someone please help me fix it. Thanks loads.
Drag And Drop
Hey people ,
My question is this: How can i enable to drag an e-mail from the inbox (not saved as a msg file )on to my VB6 application icon so that the appliaction starts and i get some kind of information about this e-mail,
Please help...
Drag And Drop
Has anyone used Drag-and-Drop on controls on a form?
I don't seem to have any luck and would like to bounce a few questions as to how DropHighlight and HitTest work.
Any help is appreciated.
TIA
-Jeff
Drag And Drop
Is it possible to disable the 'drag and drop' ability in Excel?
Drag And Drop
I'm making a voodoo doll game and I want to have an image box to be able to be draged and droped on top of another image box, but all I can do so far is drag the box but I can't find out how to drop it. Can anyone make up a code sample to help me? I've been at this for a while so any help would be great.
OLE Drag/drop
hi, could someone explain to me how the 'effect' thing works with OLE dragging and dropping. VB has 4 constants, move, copy, none and scroll. when i drag from another control the effect is set to 3 (im guessing this is move+copy) but if i drag from windows explorer i get 7. ive checked google but what i looked at only says theres the 4 options that VB gives me
Drag And Drop
Greetings,
I want to have a command button bring up a box in sheet one with data from sheet 3 and then be able to drag individual items from the box and drop then in cells on sheet 1. Is this posible? and would I use a list box or something like it? Thanks in advance.
Drag/drop
hi, i just found out how to drag a file into my app, now how to i drag it back out? im using a listbox for the items and i want to be able to drag an item to another listbox and into explorer. please help
Drag And Drop
Hi
I am writing a maths program supporting multiplication. The user can select tables from 1 to 10 and is then asked to fill in the numbers. I want to drag a number from a label. Is there any way other than to use almost 100 icons to cover all the tables? If the user drags 11 then I must have a 11.ico annd so on. Is ther a way around this.
Best wishes from Iceland
Drag And Drop
I am creating a quiz for Chemistry.
I want to include an interactive atom. Where there will be a picture of an atom, 3 words at the side to represent the parts of the atom (protons, electrons, neutrons and nucleus) and spaces where the user can drag the word and put it into the space.
It should be that if the user drags and then drops the word into the correct area then ti stays there. If moved to the wring blank space then the word moves back to its original starting place.
I've been told that labels should be used for the words that have to be dragged? Adn PictureBoxes to drag the labels into?
Can anyone help? Source code would be great.
Drag && Drop Please Help !!!
Hello,
I am having problem with Drag & Drop part, for right now i have no idea what to do, i haven't done this before. I am writing a scanning module that allows scan, drag and drop of image in the image list. My Mouse Down Event looks like this (Only know how to do this event):
Private Sub LEADRasImgList1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim nItem As Long
If Button <> 1 Then Exit Sub
nItem = LEADRasImgList1.HitTest(x, y)
If (nItem >= 0) Then
LEADRasImgList1.SelectionColor = RGB(255, 0, 0)
LEADRasImgList1.Item(nItem).Selected = True
End If
End Sub
Mouse Move Event (have no idea what should i put in here):
Private Sub LEADRasImgList1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
......???????
End Sub
Private Sub LEADRasImgList1_DragOver(Source As Control, x As Single, y As Single, State As Integer)
..........????
End Sub
Private Sub LEADRasImgList1_DragDrop(Source As Control, x As Single, y As Single)
.........?????
End Sub
-------------------------------------------------------------
Could anyone please tell me what how to do this. Thanks in advance for any help
Drag And Drop Help
Hey
I'd like to know how to drag a label into a picturebox, and when it is dropped on top of the picturebox you can see the contents of the label in the picturebox. So far all i've managed to do is make the label able to be dragged only on to the picturebox, and when it is dropped on top of the picturebox, the label is made to go to the same position as the picturebox, but you can't see the label once it has been moved there.
The only code i have for the drag and drop so far is:
Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
If Source = Label4 Then
Label4.Left = 600
Label4.Top = 2280
Else
End If
End Sub
Can anyone help or recommend another way to do this, perhaps not using a picturebox?
Thanks
Drag Drop
Anyone know how I can use drag and drop to drag just the selected items out of a file list box?
Drag And Drop
ok how can i drag and drop a .log into a textbox and display the file path of the file?
thanks
Drag And Drop
How do I make it so I can take a picture and make it the background and then be able to have pictures on the side that I can drag over and move to the space I want for example have a Christmas tree as the background and then make ornaments as images able to drag and drop so they can decorate the tree themselves??
Drag Drop
Code:
Private Sub ListView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
If Data.GetFormat(vbCFFiles) Then
For i = 1 To Data.Files.Count
ListView1.ListItems.Add , , Data.Files(i), , 3
Next i
End If
End Sub
how can you tell if the user has dropped a file or a directory other than using scripting to see if the file exsists and if not then it's a directory (which is flawed anyhow)
Drag And Drop
Here's my project. I have 2 forms, one with a TreeView and one with a DataGrid. I have a few questions I need to have answered to make my project work properly with the overall objective being that I would like to be able to click on a cell in a DataGrid, hold down my mouse, and drag the cell's value to a TreeView where the newly created TreeView Node will have the value of the cell I just drug. Here are my questions:
1) How can I tell when and where I'm clicking on a DataGrid?
2) Once I can tell where I'm clicking, how can I get the value of the cell I'm clicking on?
3) How do I automatically create a TreeView node by dragging and dropping?
4) How do I change the cursor for these events(On mouse hold down, on drag, on let go and on let go if can't be dropped in the corresponding location?
Thanks in advance and if anyone needs any code on how to populate a tree view from a database with code and a datagrid that is searchable, with code, let me know. Thanks, Jeremy
Drag And Drop
I have a DataGrid and I want to be able to highlight a row with my mouse click, already completed, and then take the value of the first row and first column and drag it onto a treeview where I will create a node with the value of the cell being drug. Does this make sense? Please help. Thanks, Jeremy
Drag And Drop
If any of you are familier with Hip-hop Ejay, then you know that you are able to Drag and Drop sound files, which is really a picturebox, to the tracks you wish. I was wondering how to do this?
I am making something like it, and want to drag the sound file to the tracks to place them there, they also need to 'lock into place' and thoughts would be great, thanks.
Drag && Drop?
Can anyone give me smoe code that lets me drag and drop a treeview's nodes around in VB??
Drag And Drop
Hi all, I've been having this slight problem with the drag and drop, now I wanna be able to move an object from one place of the screen to another and have it stay where I want it, I was able to do this with this coding>
Dim XX As Long, YY As Long
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
XX = X
YY = Y
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
With Command1
.Move .Left - (XX - X), .Top - (YY - Y)
End With
End If
End Sub
----
but I have the inconvinience that it calls up the object every mousemove so when I click on it to move it, it leaves a trail or repetition of the object until I release it at which point it does stay where I want it to. I would like to know if there was a way which I could eliminate this trail or repetition........AND if it is possible to integrate such coding with the OLE drop mode, cause with my present coding the OLE drop mode wont work
Thanks in advance
Drag Drop
I want to set up a form where i'll be able to drag and drop a label from one place to the next.. how can i do this? Thanks
|