Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




ListView DRAGGING


How can I select multiple items by clicking and then dragging over the amount of records that are there?

thanks...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Listview - Turning Off Dragging
I'm in one of my old apps and noticed that for some reason I used a listview control when a listbox "might" have done the job. My comments aren't as good as they should be (lesson learned). Anyway, since I'm not sure why I used a listview instead of a listbox I'm not willing to replace it. I don't have the time.

So... Is there a property (that I can't find) that turns off dragging of items in the listview control?

Thanks,
Bernie

Dragging And Dropping From One Listview To Another
Hi all,

How can I drag and drop multiple items including their subitems from one listview to another. Please help.

Thanks,
Nitesh

Dragging Listview Items
How to drag Listview Item to another form with the same format of Listview.??? hElp please??

Listview Dragging Item
Hello, Jusk asking if there is a possible way to drag item in the listview??

it goes like this:

Listview populate with;

Item 1
Item 2
Item 3

When I drag Item 3 to the position of Item2, it goes like this;

Item 1
Item 3
Item 2


is this possible?? if not?? what should I do??

Listview Icons And Dragging
Is it possible to have the listview Items containing icons not able to drag? If so how?

ListView And Turning Off Dragging
I have Listview with a number of items and I want a user to be able to select an item by clicking on it. Currently, if they click and drag then the icon and text go flying all over the window. How do you keep them from being able to click and drag on the icons messing up the entire list view but still allow them to click and select one? There are a number of related posts but noone seems to have a straightforward answer and this seems easy. Help please!

Thanks.

Create Shortcut By Dragging From Listview
Was wondering if someone could show me an example of creating a windows shortcut by dragging an item out of a listview control and say onto the desktop.

When creating the shortcut I would like to link to a specifix .exe, but use what was dragged out as part of the command line parameters.

Thanks in advance

Listview: Disabling User Dragging
Is there a way to disable the user from dragging items in a listview. My listview.view=lvwIcon and has to stay that way (e.g. I need the nice large icons)

Thanks in advance,

Listview Setting No Column Dragging
Hi all
you know how with the listview columns you can drag them?
howdo i stop this or get it to resize as soon as the user drags it so its kind of asking howto set the drag to be undraggable


Tom

Dragging Multiple Items From A Listview
i have some code to let users drag an item from a listview onto a treeview node, which works fine, but now i want to let them drag multiple items.

the problem is that when then select a bunch of items, then drag them to the treeview, it leaves only the last item they clicked on selected (as if they selected them, then just left-clicked one of them). is there a way to keep them all selected?

also, just out of interest, is there a way to make the drag icon include some text from each selected listview item along with an icon (like when you drag multiple files in windows explorer)?

thanks for any help

Problem With ListView Control And Dragging
I'm trying to drag an item from one ListView control to another but whenever I click on any of the items the first item is selected no matter which I have clicked on. The drag outline does appear over the selected object though. The ListView control is in report view and all the other relevant code is below, can anyone suggest what I've done wrong?

Many thanks
Geoff

Setting up control:
Dim itmX As ListItem

lsvEvents.ListItems.Clear
lsvEvents.ColumnHeaders.Clear
lsvEvents.ColumnHeaders.Add , "Event", "Event", lsvEvents.Width / 2
lsvEvents.ColumnHeaders.Add , "Time", "Time", lsvEvents.Width / 2
lsvEvents.SmallIcons = imlLog

For each record in a recordset:
Set itmX = lsvEvents.ListItems.Add()
itmX.Text = !Name
itmX.Tag = !EventID
itmX.SubItems(1) = !OpenTime

Select Case !EventType
Case Is = "<Project File>"
itmX.SmallIcon = "Project"
Case Is = "<Resource File>"
itmX.SmallIcon = "Resource"
Case Is = "<Issue>"
itmX.SmallIcon = "Issue"
End Select

MouseDown:
Private Sub lstEvents_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim DY ' Declare variable.



DY = TextHeight("A") ' Get height of one line.
lblDrag.Move lstEvents.Left, lstEvents.Top + y - DY / 2, lstEvents.Width,
DY
lblDrag.Drag ' Drag label outline.
End Sub

Problem With ListView Control And Dragging
I'm trying to drag an item from one ListView control to another but whenever I click on any of the items the first item is selected no matter which I
have clicked on. The drag outline does appear over the selected object though. The ListView control is in report view and all the other relevant code is below, can anyone suggest what I've done wrong?

Many thanks
Geoff

Setting up control:
    Dim itmX As ListItem

    lsvEvents.ListItems.Clear
    lsvEvents.ColumnHeaders.Clear
    lsvEvents.ColumnHeaders.Add , "Event", "Event", lsvEvents.Width / 2
    lsvEvents.ColumnHeaders.Add , "Time", "Time", lsvEvents.Width / 2
    lsvEvents.SmallIcons = imlLog

For each record in a recordset:
                    Set itmX = lsvEvents.ListItems.Add()
                    itmX.Text = !Name
                    itmX.Tag = !EventID
                    itmX.SubItems(1) = !OpenTime

                    Select Case !EventType
                        Case Is = "<Project File>"
                            itmX.SmallIcon = "Project"
                        Case Is = "<Resource File>"
                            itmX.SmallIcon = "Resource"
                        Case Is = "<Issue>"
                            itmX.SmallIcon = "Issue"
                    End Select

MouseDown:
Private Sub lstEvents_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
   Dim DY ' Declare variable.
   
   
   
   DY = TextHeight("A") ' Get height of one line.
   lblDrag.Move lstEvents.Left, lstEvents.Top + y - DY / 2, lstEvents.Width,
DY
   lblDrag.Drag ' Drag label outline.
End Sub

Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!

thanks!

Disable Dragging Items In A Listview Control. Help, Help, Help
I don't know how to disable dragging items in a listview control. Please help me. thank you very much

Please Double Check This Dragging From ListBox To ListView Code For Me
I want to drag an item from a listbox to a listview so starting with my lisbox code:

Private DragID As Integer
Private blnAmDragging As Boolean


Code:
Private Sub lstUnalloc_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbLeftButton Then
DragID = lstUnalloc.ItemData(lstUnalloc.ListIndex)
End If
End Sub



Code:
Private Sub lstUnalloc_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
On Error GoTo errh

If Button = vbLeftButton Then
If lstUnalloc.ListIndex >= 0 Then
blnAmDragging = True
lstUnalloc.Drag vbBeginDrag
End If

End If

Exit Sub

errh:
errmsg "The following Exception occured : " & Err.Description & ", " & Err.Source & "", "Exception occured in frmMain.lstUnalloc_MouseMove ()"

End Sub


and now my listview:

Code:
Private Sub lvwPeople_DragOver(Source As Control, x As Single, y As Single, State As Integer)

On Error GoTo errh

If blnAmDragging = True Then
If State = vbLeave Then
Set lvwPeople.DropHighlight = Nothing
Else
Set lvwPeople.DropHighlight = lvwPeople.HitTest(x, y)
End If
End If

Exit Sub

errh:
errmsg "The following Exception occured : " & Err.Description & ", " & Err.Source & "", "Exception occured in frmMain.lstlist_DragOver()"

End Sub



Code:
Private Sub lvwPeople_DragDrop(Source As Control, x As Single, y As Single)

If Source = "lvwPeople" Then
Exit Sub
End If

Source.Drag vbEndDrag

Set lvwPeople.SelectedItem = lvwPeople.HitTest(x, y)

MsgBox lvwPeople.SelectedItem.Key
MsgBox DragID

End Sub


I just put 2 msgboxes to test. I have to write sql statements to assign the number to a person. I just need someone to check if I am doing the correct stuff for dragging and dropping.

Dragging Listview From One Form To Another Form..
How to drag Listview Item to another form with the same format of Listview. not a Listitems???? hElp please??

Dragging Help
i need to kno how to make a form so when you draag it to within 120 of the left of a screeen it sticks there, and is able to be dragged away again, like winamp can do. any help appreciated.
thank you.
ollie.

Dragging .. Please Help
Hello,

im trying to make an audio player... there is a play list (list box)... and i want it that, when the program is open, you can drag a song icon (lets say from the desktop) onto the listbox and the file name is displayed there..

can anyone please help?

Thanks!

l8er

Dragging
ok, I know what picture.drag 1 and picture.drag 2 is, but how do I conbine them to make a drag and drop thing? all I want to be able to do is drag a picturebox around the place, but how?

Dragging What?
How can I know which object is being dragged?

If I use DragMode: automatic, seems the GotFocus is not working.

What I try to do is like VB IDE, drag an object and put into another container.

Besides, I also need to draw the 6 small squares to allow user to resize.

I tried to use DragMode:Manual, but then for ComboBox, I cannot trap mouseevent like MouseDown etc !!

Any solutions???

Thanks

Knows That It Is Dragging?
If I use DragMode=Automatic,
How can I know it is being dragged?

Thanks

Dragging
I want to drag a button from one area of a form to another. I suppose this requires a calculation of the cursor position, and then some code for the Form object. But I cannot find out a way to do this seemingly obvious task. I know to set drag property of my button to "1", but beyond that it is a mystery to me.

Dragging
How can i make a object move like drag it to another spot ?

Dragging
Is there a way to drag a path from Window Explorer on to a textbox?

Dragging Help
I'm having a problem with the following code and I need a tip or workaround:

Dim OldX As Single
Dim OldY As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - OldX
Source.Top = Y - OldY
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
OldX = X
OldY = Y
Picture1.Drag
End If

The problem is the x,y of the form is not realized unless the cursor leaves the original plane of the picturebox. In other words if you put the cursor in the middle of a picbox that is 1000 whatevers wide by 1000 whatevers high you can't move the picture box 499 or less whatevers. Any help?

Thanks,
Joey O

Dragging
When I click on my label, the drag box comes up but when I release it the label stays in the original place, help !

Dragging A SSTab Outside Of An App.
Hello and Good day to all. Thanks for any replies to this post!

I was wondering if it is possible to enable a drag and drop method for an sstab. What i would like it to do (the app) is allow users to drag 1 of the sstabs outside of the program area and once the mouse is release, the window will act as its own independent form. For example:

__Tab1____Tab2____Tab3__


When the user clicks and Drags Tab1, they drag it outside of the main form..(so the mouse if over the desktop for example). When they release the mouse button Tab1 becomes its own form, and is independent of the main form. So if the original was closed, Tab1 would not be.

Like so:

__Tab1__________________


And this is to apply to each SSTAB.

Not sure how one would go about accomplishing this.

Any comments or suggestions would be appreciated.

Thanks again for view and/or replying to this post.

Much appreciated!

Dragging Labels Around..
Say I have a few "columns" just seperated by simple lines, with a bunch of labels in each "column", how would I go about being able to drag labels between and within columns?

Dragging A Polygon
Dear list

I have made some shapes using the polygon api and filled them with colour. Currently I can identify when the mouse is over the polygon using point(X,Y). From this I am able to drag the polygon across the screen by continually using CLS and remaking the polygon at the current mouse point. This is understandably flickery and depending on tyhe speed of the PC - can be quite slow. Has anyone got a suggestion how I could drag the polygons better. Note they cannot be placed inside another control!

any ideas would be much appreciated.

Thanks

Optom

Dragging A Polygon
I have created a polygon using the polygon function in the API. Is there any way I can drag it with the mouse as if it were an object?

Thanks

optom

Dragging An Image Over Another One
While I'm dragging an image over another one, the one under is being refreshed, which makes the movement unclear. How to get rid of this?

How Can I: Select Pcb's By Dragging...
Yo...

its been a while since i've been here...
i've tried to find an answer to my problem...
but couldnt find one.

So here is my problem:
I want to MoveOver some pictureboxes (pcb's)...
and when i hold the leftmousebutton,
i want the pcb's to change color.

Seems rather easy...
but im not really getting there...
what i got so far:

Code:
Private Sub pcbSth_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If pcbMon(Index).BackColor = &H80000001 Then
pcbMon(Index).BackColor = &H80000005
Else
pcbMon(Index).BackColor = &H80000001
End If
End If
End Sub
thing is...
i have to stand totally still for 'selecting'...
and i can only do one at a time...

anyone any ideas?

tnx anyway...

Need Help With Dragging Tiles
I been searching the board and havent found this issue addresses directly, so perhaps someone has a suggestion.

I am making a tile sliding game, so I need to be able to move tiles (in this case picture boxes) along either the x or y axis and have them scroll smoothly and I drag them with the mouse.

I have experimented with changing the pictures x or y as I register x and y from the mousemove event, but this leaves a trail and just doesn't seem to be working right.

I don't think this is too rare of an 'effect' so I assume there is a normal way to do it - do I use bitblt? I don't know much about that yet, but I see it mentioned on the board a lot.

Also, I am getting the ghost of the picture box when I drag and i dont want that. I feel I probably need to handly this sliding outside of the basic drag and drop technique but I'm not sure

Thanks for the help

Pete

Dragging In Lists
This may get a bit complex, so ill try to explain it best i can.

I have two listboxes, list1 list2.. Each item in list1 is corresponding with list2.. for example:

List1 Contents
1+1
2+2
3+3

List2 Contents
2
4
6

Is it possible to drag a list1 item from its current position (index) and move it somewhere else in the list, while also moving the corresponding list2 item to the same index in list2?

Thanks

Dragging A Image!?
Hi everyone, I was just wondering if anyone knows how to simply move an image from one place (lets say point a) to anotehr place and telling it to stay whereever i have dragged it to (lets say point b)??

thanx for the help

Dragging To A Folder
I want to create an application that when installed, creates a special folder with my unique icon. When cetain types of files are dragged to this folder, my application kicks off and runs a process on them. Is this possible in VB, or do I need to search for a different language? I searched the forum and could not find any other post like this.

Thank you.

Dragging Frames Or Tab Help?
I have a form and a SSTab1 and would like to keep some buttons that do the same thing on 3 of the 5 different Tab pages or w/e you call them. I don't know how I would keep them ontop for the certain pages. I was thinkng of a frame that can be dragged around on each form or how would I do it?

Thanks for all help

Dragging A Form
Hi all,

I have created a form that pops up and follows the curser around the screen when you are dragging an item from one list to another. This works with a timer on the form that repeatedly repositions the form next to the curser using the GetCursorPos function. I have a text box on this form that I want the user to be able to type in whilst dragging an item. If the moue button is not held down (and the form is just following the cursor), the text box accepts text quite happily, but when the mouse is held down as you are dragging an item, te text box does not accept text any more!?
I have tried using the GetKeyState function in the timer loop combined with a loop to go through the ascii key codes, to place letters that are pressed after the existing text in the box, but that doesnt account for the other keys on the keyboard such as the curser keys, delete, backspace, etc.

Does anybody have any suggestions on how I can make the text box accept input while the mouse button is pressed and dragging?

Any help would be great

Thanks in advance, Al.

Dragging An Object
I'm trying to design a seating plan kind of program for teachers where they can take a desk and drag it to where they want it...How can I allow a richtext box (the object i'm using for a desk so it can be written on) to be dragged? Also how can I get it to rotate it?

Thanks,

Dragging And Dropping
Hi,

I'm trying to make a part of a program, but I'm just getting really stuck.

I need to be able to drag and drop jpeg files into image (or picture but preferably image) boxes from windows explorer.

Can anyone help?

Thanks,

Adrian Osmond.

Dragging A CommandButton
How would i make it so that the user could drag a command Button, that is currently in a PictureBox?

Dragging Files Into VB
Ok, I am creating a project for school and I need to know if there is a way to take all the files in one folder and print just the names of the file to a .txt file.

For example

My Documents has 10 mp3's all named 1.mp3 - 10.mp3

I need to get vb somehow to extract all those to a txt file saying

1.mp3
2.mp3
3.mp3
...etc

Can this be done?

Dragging The Form
I have a form with no border. Is there a way to drag the form and move it around the screen without having the title bar to click on? thanks

Dragging Textboxes
I'd like to be able to drag one text box over another and have it copy the contents of the box into the one it's over.

Is there any way to go about doing this?

Dragging And Dropping
Does anyone know how you can drag and drop and object to anywhere on the page? If i set dragmode to automatic i can drag it but it drops back to its previous location.

Help With Image Dragging...HELP ME PLZ
in my program i am making it is like ms paint and i have an insert picture option now when the user imputs the picture it puts it on the form now how can i ame it so the user can move it to where ever they want it on the form...Plz Help

Dragging And Listbox Help
hello, i have already got code to drag a file into a list box

Private Sub Form_Load()
List1.OLEDropMode = 1
End Sub
Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Integer
If Data.Files.Count < 1 Then Exit Sub
For i = 1 To Data.Files.Count
List1.AddItem Data.Files(i)
Next i
List1.Refresh
End Sub

but i need to know how to only add certain files like exe's or jpg's etc. i also would like to know how to display only the filename in a listbox called list2. any help would be appreciated.
thank you, ollie.

Dragging && Dropping
I have a textbox on my form named "Text1"...

This textbox has a drag/drop event that takes the path of the file dropped and makes it the Text1.text...

The problem with this is... it accepts any file type...

Is there a way to limit dragging/dropping to only certain file types?
(If possible, can I have only .exe's & .lnk files accepted by the drop, with everything else causing a "cannot drop" icon?)

-------------------------------------


!!!SOLVED!!!

The harder question...

In the previous question, I wanted .lnk files to be dropped too... The only problem with this is, when you try to shell() a .lnk file, it gives an error... So, do I need to extract the .exe filepath from the .lnk, or is there a way to correctly shell() a .lnk file?

If I do have to "extract" the filepath from the .lnk to the real .exe's filepath, how do I go about this?

!!!SOLVED!!!

I figured out the second question with the help of someone's example project on how to create shortcuts and gather information from them. I'm not sure who posted it, it was one of the gurus... Thanks whoever you are!


Help on the first question still needed!

Thanks!

Form Dragging
Ok my form is useing a graphic image over the form but im having a problem dragging the form, I keep getting Compile err0r: Sub or Function not defined.


Code:
Private Sub Label3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Drag Me
End Sub

Help

Copyright © 2005-08 www.BigResource.com, All rights reserved