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




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




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Dragging Listview Items
How to drag Listview Item to another form with the same format of Listview.??? hElp please??

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

Add Items To A Listview Multiple Columns
Hi... I have a listview with 3 columns... how can i add items to the second and the third column? i know it's a stupid question but i can't solve it


Thanks in advance

simons

Moving Multiple Listview Items Up Or Down At Once
Hi, does anybody know how to move multiple selected listview items up or down at once?

I found the subs below, but they only move one item up or down, even if I have selected multiple items.

Thanks.


vb Code:
Private Enum menmDirections    MoveUp = 1    MoveDown = 2End Enum Private Sub MoveItem(ByVal penmDirection As menmDirections)Dim lvwItem     As ListItemDim lvwNew      As ListItemDim lvwSubItem  As ListSubItemDim lngIndex    As Long    Set lvwItem = lstView.SelectedItem    If Not (lvwItem Is Nothing) Then        If penmDirection = MoveUp Then            lngIndex = lvwItem.Index + 2        ElseIf penmDirection = MoveDown Then            lngIndex = lvwItem.Index - 1        End If        If lngIndex > 0 And lngIndex <= lstView.ListItems.Count + 1 Then            Set lvwNew = lstView.ListItems.Add(lngIndex, , lvwItem.Text)            For Each lvwSubItem In lvwItem.ListSubItems                lvwNew.ListSubItems.Add , lvwSubItem.Key, lvwSubItem.Text, lvwSubItem.ReportIcon, lvwSubItem.ToolTipText            Next lvwSubItem            lvwNew.Selected = True            Set lvwNew = Nothing            lstView.ListItems.Remove lvwItem.Index        End If        Set lvwItem = Nothing    End IfEnd Sub



vb Code:
Private Sub MoveUp(lv As ListView)    Dim itm As ListItem, itmNew As ListItem, i As Long    If lv.SelectedItem.Index > 1 Then        Set itm = lv.SelectedItem        Set itmNew = lv.ListItems.Add(itm.Index - 1, , itm.Text, itm.Icon, itm.SmallIcon)        For i = 1 To itm.ListSubItems.Count            With itm.ListSubItems(i)                Call itmNew.ListSubItems.Add(, .Key, .Text, .ReportIcon, .ToolTipText)            End With        Next        lv.ListItems.Remove itm.Index        itmNew.Selected = True        lv.SetFocus    End IfEnd Sub Private Sub MoveDown(lv As ListView)    Dim itm As ListItem, itmNew As ListItem, i As Long    If lv.SelectedItem.Index < lv.ListItems.Count Then        Set itm = lv.SelectedItem        Set itmNew = lv.ListItems.Add(itm.Index + 2, , itm.Text, itm.Icon, itm.SmallIcon)        For i = 1 To itm.ListSubItems.Count            With itm.ListSubItems(i)                Call itmNew.ListSubItems.Add(, .Key, .Text, .ReportIcon, .ToolTipText)            End With        Next        lv.ListItems.Remove itm.Index        itmNew.Selected = True        lv.SetFocus    End IfEnd Sub

Listview - DragDrop Multiple Items
I have the following code that successfully will drag & drop one item at a time, but doesn't work all the time if multiple rows are selected?
When I start to drag, sometimes nothing happens.

Anybody point me in the right direction please?


Code:
Private Sub lvwSelected_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
On Error GoTo ErrTrap

Dim i As Long
Dim lvwItem As ListItem

For i = 1 To lvwSource.ListItems.Count
If lvwSource.ListItems(i).Selected = True Then
Set lvwItem = lvwSelected.ListItems.Add(, , lvwSource.ListItems(i).Text)
lvwItem.SubItems(1) = lvwSource.ListItems(i).SubItems(1)
lvwItem.SubItems(2) = lvwSource.ListItems(i).SubItems(2)
'remove original item
lvwSource.ListItems.Remove i
End If
Next

Also, when dragging multiple items across, and removing the original item, I now get an error because the ListItem.Count is now out of bounds.
How would I handle this?
Would I add 1 to the value of 'i' before the next loop?

Multiple Selected Items In A Listview
Hello, how can I find out how many selected items there are in a listview?

I'm showing a popup menu when the user right-clicks on an item, but I need to know if only 1 item is selected, so I can disable a menu option.

I've tried this, but it doesn't work.


VB Code:
If ListView.SelectedItem < 2 Then mnuCopyMultiple.Enabled = False

Remove Multiple Items From ListView
I've got a ListView control with the MultiSelect property set to True and would like to remove all of the selected items only. I've looked at some of the threads concerning this issue but am still having trouble. I can remove a single selected item but not all of the selected items. My code is as follows:


Code:
Private Sub cmdRemove_Click()

Dim I As Integer

For I = 1 To lstPlot.ListItems.Count
If lstPlot.ListItems(I).Selected = True Then
lstPlot.ListItems.Remove (I)
End If
Next I

End Sub


What am I missing?

Thanks for your help!

Multiple Select Items In Listview
im having a problem in listview. ther ar 2 listviews for Excel and server. the user will select fields in th excel lisview he want to upload in server lisview. it upload a field if the user only select 1 field. but if it highlights many fields it only copy the lastselected fields the other fields highlighted dont work. heres my code:

j = LVExcel.ListItems.Count
 For i = j To 1 Step -1
  If LVExcel.ListItems(i).Selected = True And LVDatabase.ListItems(i).Selected = True Then
        Set rs1 = New ADODB.Recordset
        destinationtble = "select * from [user]"
        rs1.Open destinationtble, gcn, adOpenKeyset, adLockOptimistic
           Do While Not RS.EOF
              rs1.AddNew
              rs1.Fields(LVDatabase.SelectedItem.Text) = RS.Fields(LVExcel.SelectedItem.Text)
              rs1.Update
              RS.MoveNext
           Loop
          Set RS = Nothing
  End If
next i

Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!

I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!

Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.

To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!

Waiting for your valuable reply ...

Regards,

Ruturaj.

Drag Multiple Items From Listview To Treeview
Does anyone have some good sample code for how to
drag multiple listviewitems to an treeview?!

I cant figure it out...

Regards

Peter

Show Multiple Items In Listview Taken From Database
How would I show multiple items from an Access database in a listview?

Example: Let's say my database looks like this:

Sender Subject Date
me@isp.com Some Subject 1-13-00 7:59AM
you@otherisp.com Some other subject 7-30-01 8:00AM

I want to load both items into a listview. My current procedure only loads one item at a time. Here is the procedure:


Code:
Dim Recordset As ADODB.Recordset
Select Case Node.Text
Case "Trash"
If Recordset.EOF = True Then Exit Sub
lvwMail.ListItems.Clear
With lvwMail.ListItems.Add(, , Recordset!Sender)
.SubItems(1) = Recordset!Subject
.SubItems(2) = Recordset!Date
End With
End Select

How To Move Multiple Selected Items To New ListView
I have 2 ListView Controls. I need to move multiple selected items from ListView1 to ListView2.

How would I go about doing this?

Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!

I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!

Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.

To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!

Waiting for your valuable reply ...

Regards,

Ruturaj.

Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!

I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!

Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.

To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!

Waiting for your valuable reply ...

Regards,

Ruturaj.

Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!

I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!

Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.

To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!

Waiting for your valuable reply ...

Regards,

Ruturaj.

Add Items Without Dragging Them In
Hi,

I'm using VB6.0 and I'm trying to find a way to create combo and textboxes without dragging them on to the form from the toolbox.
I want to make a program to print out bills and each time the value in the combo is selected, a new combo should appear without using comboboxx.visible = true.

Thanks

Dragging Items In A Treeview Between Itself
I've got a tree view control in my application and i need to drag its children nodes between the parent nodes. I.e you can be able to change the parent node just by dragging a node from one parent node to anotehr. Is this possible to be done by native VB, or does it need some API involveD?

I've seen several applications using this functionality. Any idea how i can solve this problem?

Thanks!

Dragging Items In A Treeview In Itself (changing Locations)
I need to perform a drag-drop function on a treeview control in which the user can move items between different nodes of the tree.

I need to implement this functionality via dragand drop, so as to make it easy to interact. Is this possible? Do i need to go into detailed API or wiht native VB it is possible?

Any ideas? Thanks a lot ppl

Dragging Multiple Picture Boxes At Once
I can't seem to figure out how to move multiple picture boxes by clicking just one of them. I have 16 boxes in a control array. I first check to see if the index is one of the 5 i want to drag as a unit, then I set all of their dragModes to begin, but instead of all of them starting to drag together, it snaps to the last box and moves it. Here is what I have:


Code:
Private Sub picTable_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbMiddleButton And Index < 12 Then
picTable(Index).Drag vbBeginDrag
Else
picTable(12).Drag vbBeginDrag
picTable(13).Drag vbBeginDrag
picTable(14).Drag vbBeginDrag
picTable(15).Drag vbBeginDrag
picTable(16).Drag vbBeginDrag
End If
End Sub

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

thanks...

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

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

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

Positioning Multiple Stacked Forms Without User Dragging/Resizing
Need some ideas/code on how to position (without user dragging/resizing):

1. Stacking of multiple forms when a new one is added -- All currently active forms will have to be compressed and
top/height adjusted accordingly.

2. Repositioning of multiple stacked forms when one is deleted so the deleted area is filled by the others.

3. Searching the registry or DB to adjust left/top/width/height
for the now (those that still visible) active forms.

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!

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 List Items Around A List Box: Example
Since I can't post this in the code library, I thought I'd share it here. This code is pretty simple. It allows items to be reordered in a list box by dragging them around.

Put this in General Declarations

Code:
Dim item1 As String, item2 As String, listindex1 As Integer, listindex2 As Integer

Put this in for your list events.

Code:
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'When the mouse is clicked, we want to save the text at the spot
'and the index of the spot to variables
item1 = List1.List(List1.listindex)
listindex1 = List1.listindex
End Sub
Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'When the mouse is released, we want to save the text and the spot
'again. Then we print the text to opposite spots in the list.
item2 = List1.List(List1.listindex)
listindex2 = List1.listindex
List1.List(listindex1) = item2
List1.List(listindex2) = item1
End Sub

Combine 2 Listview Items Into One Listview
I have 2 listviews that have a different listitems.

ex.

LV 1 LV 2
1. A 1. B
2. C 2. D
3. E 3. F


Is there a way to combine the 2 to another listview so that they all look like this with out doubles of matching items?

ex.

LV 3

1. A
2. C
3. E
4. D
5. E
6. F

Combine 2 Listview Items Into One Listview
I have 2 listviews that have a different listitems.

ex.
________________
LV 1 l LV 2 l
l l
1. A l 1. B l
2. C l 2. D l
3. E l 3. F l
_______l_________l

Is there a way to combine the 2 to another listview so that they all look like this with out doubles of matching items?

ex.
_______
LV 1 l
1. A l
2. C l
3. E l
4. D l
5. E l
6. F l
_______l

Multiple Items In A Collection
Hello all,

I've got a (simple?) question that has me flabberghasted.
I'm trying to program a simple pacman clone.


The 'Maze' object has a collection of ghosts, that get filled like this:

For col = 0 To 1 'create some ghosts for testing
For row = 0 To 1

Set Ghost = New clsGhost

Ghost.PosX = col * 14 * 48
Ghost.PosY = row * 8 * 48
Ghost.Speed = 20 * row + 40 * col

Ghosts.Add Ghost

Next row
Next col


If the ghost is to walk around in the maze, it has to know about possible
directions, so the ghost can raise an event to its parent (the maze):

RaiseEvent GetDirection( iPosX SQUARE_WIDTH + 1, _
iPosY SQUARE_HEIGHT, _
MazeDir)


Now, if I create only ONE ghost, then it will run happily around the maze
However, creating MORE ghosts causes the program to skip the 'RaiseEvent' instruction. ( detected during single stepping)

How can I make the 'RaiseEvent' instruction work for multiple instances of the ghost class?

TIA,
Alvatrus

Multiple Listbox Items
I have a standard listbox that instead of only one item per line I have 3 items per line such as: Quantity, ItemNum, Price. I want to add these items to their matching columns in my database of quantity, ItemNum, and Price.

Is there a column property of the listbox that I can use to extract the Items individually?


rs is my recordset

Do while rs.Eof = False
list1.addnew = rs!Quantity
Loop

This only gets one item per line.

Searching For Multiple Items
is there a way to search for more than one item at a time?

ex text

i have a red fox
i own a red car
i have six blue coats

and my search terms are: car and blue

result

i own a red car
i have six blue coats

this might be a pretty dumb ?, but then i am not a code guru

Parse Multiple Items; Help!
I have another problem, I want to be able to parse multiple userID's from a page of online users, the code I want to get between is:

Code:


Code:
_vchat_174375447'


The userID being 174375447.

I used:


Code:
Dim StrPage As String
StrPage = Inet1.OpenURL("http://www.stickam.com/whosLive.do?listType=live")

StrToken = GetBetween(1, StrPage, _
"vchat_", "'", vbTextCompare)

lstGen.AddItem (StrToken)


The code parses the string of text correctly, but my situation is that I have more than one userID in a page. So I don't need it stop after finding one, I need it to find one userID, add it to a listbox, then move onto another userID in the data, then add it to a listbox and so on. In advance of acknowledgment, each userID has the same beginning and ending:


Code:
_vchat_userID'


Thank you,
mikeyy.

Lists And Getting Rid Of Multiple Items
Hi,

Is there any way to remove multiple items for a list. For example, the list:

A
H
A
A
K

Is there any way I could just turn it into:

A
H
K

...and remove the extra A's. Thanks.

Multiple Items Ina TEXTBOX
Hello there, is there any way where we can add items to a text box instead of a combo box... Currently I am retrieving a list of items say customer names into a combo box.. Instead of a combo box can we add multiple items into a text box....ANY SOLUTIONS ?????

Multiple Items On Same Invoice
Hello,

I am developing an order tracking system for an organisation which repairs printers, monitors and other computer parts. Each Invoice generated should have entered multiple items like printers, monitors or others on it. How do i proceed ? I mean what controls in vb should i use so that multiple items can be choosen for same invoice id ?

Can anybody help me ? Please....

Ashish Kamat

Add Items To Multiple Forms
Hello,

I have two forms with comboboxes. These comboboxes have the same items. Is there an easy way to fill these comboboxes with a single routine?

I now fill the two comboboxes with two seperate routines

Sub FillNewUserForm
frmNewUser.cmbLocation.AddItem "Amsterdam"
frmNewUser.cmbLocation.AddItem "Utrecht"
frmNewUser.cmbLocation.AddItem "Rotterdam"
End Sub

Sub FillChangeUserForm
frmChangeUser.cmbLocation.AddItem "Amsterdam"
frmChangeUser.cmbLocation.AddItem "Utrecht"
frmChangeUser.cmbLocation.AddItem "Rotterdam"
End Sub

How To Select Multiple Items From A List Box To Another?
Hi guys..

I'd like to know how to select multiple items from a main list box to another list box? I've enabled the select extended on the main list box? Also, how do i remove multiple?
Currently, I can only move one item at a time.

Thanks!!

Regards
Vivien

Add Items In Multiple Columns Of A Listbox
Does anyone know how to add items into 2 columns of a listbox?
I have 2 columns but when I do this:
lstTopic.AddItem rs.Fields(0)
the value is added into the first column. How do i add an other value in the second column?
Thanks!!

Remove Multiple Items From A Listbox
How can I remove multiple items from a listbox?

I have tried this, but it won't work....


Code:
Dim i As Integer

For i = 0 To Me.lstFiles.ListCount - 1
If Me.lstFiles.Selected(i) = True Then
Me.lstFiles.RemoveItem Me.lstFiles.List(i)
End If
Next i

Remove Multiple Items From Listbox
Hi,

I have a listbox which is multiple selection enabled and I have a button which removes all selected items by looping through like so:


Code:
Do While PlayList.SelectedIndex <> -1
PlayList.Items.RemoveAt(PlayList.SelectedIndex)
Loop
This works, the problem is I have another piece of code which is triggered by the selected index being changed. It checks the count of the listbox and if empty does one thing and if not does another.

The problem is the selected index changes before the item is removed which means that even when the list is empty the count shows one and the program takes the wrong path.

Can anyone help?

Thanks
Stephen Reid

Listbox And Remove Multiple Items
i have this code for loading and removing items from a list box. i am generating an error with my remove item statment. i want to add the item at position i to the correct list box and also delete the item at postion i from both boxes. how i generate an invalid procedure call a the first removeitem command in either statement.

dim x as interger
x = 4

If card1Value > card2Value Then
MsgBox "card1 bigger " & card1 & " " & card2
For I = 0 To X
MsgBox I
lstDeck1.AddItem lstDeck1.List(I)
lstDeck1.RemoveItem lstDeck1.List(I)
lstDeck1.AddItem lstDeck2.List(I)
lstDeck2.RemoveItem lstDeck2.List(I)

Next
Else
MsgBox "card2 bigger" & card1 & " " & card2
For I = 0 To X
MsgBox I
lstDeck2.AddItem lstDeck1.List(I)
lstDeck1.RemoveItem lstDeck1.List(I)
lstDeck2.AddItem lstDeck2.List(I)
lstDeck2.RemoveItem lstDeck2.List(I)
Next I


any thoughts?

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