Listview Finditem, Result At Top Of Listview
Hello,
I use the function FindItem in order to find what I want. I have one problem : I would like that the result is at the top of the listview, it means, the first visible, not the first of the complete list.
Thanks you
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
.FindItem With Listview
Code:
For SortX = 1 To colMyItem.Count
Set itmX = Shop_ListView.ListItems.Add(, , colMyItem.Item(SortX))
With itmX
.SubItems(1) = colMyStock.Item(SortX)
.SubItems(2) = colMyOld.Item(SortX)
.SubItems(3) = colMyOld.Item(SortX)
.SubItems(4) = colMyId.Item(SortX)
End With
Next SortX
lvAutosizeControl Shop_ListView
'Ok So now I'm trying to find if the value of Subitems(3) is = to "0" This code is throwing an error...
For PriceX = 1 To Shop_ListView.ListItems.Count
If Shop_ListView.FindItem("0", lvwSubItem) Then
Shop_ListView.ListItems.Item(PriceX).Checked = True
End If
Next
ListView Won't FindItem!
I'm trying to find a string in the listview, more specifically in the third column.
Anyone knows why this is not working? (code inside event t_modelo_keypress):
strData = UCase(Me.t_modelo.Text) 'Couse everything is in upper in the list
If KeyAscii = 13 Then
Set itmFound = Me.ListView1.FindItem(strData, 1, , 1)
If Not itmFound Is Nothing Then
itmFound.Selected = True
itmFound.EnsureVisible
End If
End If
Thanks in advance.
ListView Finditem
Hi everyone,
I'm very new to the Listvew control. This is a very simple problem i know.
I have 4 items suppose in the listview control:
yahoo
google
msn
sony
They can be in any order.
I want to find the Listindex (the index number) of the 'yahoo' item.
Listview.finditem
Hi,
VB Code:
Dim itemX as ListItemSet itemX = listView.FindItem("String", lvwSubItem)
how can i check whether it finds an item or not?
Thanks
Jain
Finditem In Listview
i tried the finditem property of listview to find text with both lvwpartial, and lvlfull but even when i do litem.selected=true or litem.bold=true the item found is not highlighted or bolded. what is the exact way to do this. and when i tell listview to find item using lvwpartial in the keypress event does backspaces also effect the find.?
Listview.FindItem ???
Hi all,
I am using a listview to display some items in the following format:
ID| Status
--------------
1 | Printed
2 | Un-Used
3 | Printed
4 | Cancelled
e.t.c
This list will be continually growing, so very soon it will hold 1000 + items.
Due to this i want to be able to use the Finditem method to let the user type in the ID number into a textbox, say 50, and then hit a button which sets of a click event like the following :
VB Code:
Private Sub CmdGO_Click() LvCheques.FindItem TxtGo, 1, 1 End Sub
TXTGo = 50
What i want is for this then to skip to & Highlight Record 50 in the Listview.
Unfortunatley this is not working, and i am not sure what values i need to put in for the second and third argument for FINDITEM.
anybody know what i am doing wrong ???
ListView FindItem
I am able to find a specific item in a list view... and set its selected value to true... How can I refresh the view in such a way to make the listview scroll to that actual value...
It is selected but if it is way at hte bottom of the immediate viewing area of the list view, one has to scroll all the way at the bottom...
Thanks much in advance...
Listview Finditem
i have searched the forum for a simple way of searching a listview with the finditem, i can find the item and i can get the index of the item but i cant seem to get it to select it.
VB Code:
Dim itm As ListItem Set itm = lv.FindItem("sometext", lvwText)MsgBox itm.Index 'just used this to make sure its finding it.
any ideas ?
thank you.
casey.
ListView FindItem
I am trying to use finditem in a listview control like this:
Code:
On Error GoTo nfb
Dim itmX As ListItem
' Set the variable to the found item.
Set itmX = Form1.ListView1.FindItem(Text1, , , lvwPartial)
'StrFind = itmX.Index
MsgBox itmX.Index
Exit Sub
nfb: MsgBox "Not Found"
but when i search for a name it dont work. Like i have a list of lets say names like
Bill Gates
Bill Gates JR
Sci fi Nill gates
Buba gates
what if i only know gates how do i find it ? and what if its like
VB Q and A Post New Thread
VB Q and A Preview New Thread
and im looking for preview how do i find it?
Using FindItem For The ListView
I am using a listview control and I am trying to use the finditem method. I have several columns of data in the listview. When I click on an item in the listview, the data will populate several textboxes so that I can make modifications to the data.
My problem is that after I make the modifications, the data is then appended to the listview as the last line of data. I want the changes to be reflected on the line that I selected and not create a new entry in the listview. I am using the FindItem method, perhaps that is not the right way.
Any help is greatly appreciated.
Thanks,
Jeff
Finditem In Listview
hi all.
i'm using microsoft windows common controls 6.
how can i use the finditem method of the listview? (simple example...)
dose it work when i'm on Multiselect=true?
thanks.
Listview FindItem
I want users to be able to search for records in a listview control by either the employee's number or last name. The search by number works fine, but I can not get the search for last name to work. The name is in the subitem(3) and printed as SMITH, JOHN. Here is my code. What am I doing wrong.
private Sub txtSearch_KeyPress(KeyAscii as Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 then
ZOUT$ = txtSearch.Text
N% = IsNumeric(ZOUT$)
If N% = -1 then
lv.Enabled = true
ZOUT$ = Right("000000" & ZOUT$, 6)
txtSearch.Text = ZOUT$
Call Search(ZOUT$, 1, 0)
Exit Sub
else
lv.Enabled = true
Call Search(ZOUT$, 1, 1)
End If
End If
End Sub
'
'
'
private Sub Search(ZOUT$, a%, Part%)
Dim itmItem as ListItem
on error GoTo EndOfList
If Part% = 0 then ''This is the search for # and it works
set itmItem = lv.FindItem(ZOUT$, 1, a%)
If itmItem = empty then
MsgBox "No record for employee #" & ZOUT$ & " found."
GoTo EndOfList
End If
End If
''This searches for a name such as SMITH
If Part% = 1 then
set itmItem = lv.FindItem(ZOUT$, 0, a%, lvwPartial)
If itmItem = empty then
MsgBox "No Matching Record Found."
GoTo EndOfList
End If
End If
itmItem.Selected = true
itmItem.EnsureVisible
Exit Sub
'
EndOfList:
If Err.Number = 380 then MsgBox "No Matching Records Found"
on error GoTo 0
End Sub
ListView FindItem Problem
Does anybody know how to find an item form a ListView of other running application?
I've tried to do that with SendMessage API function but results error.
I post my code here so maybe anyone could help.
I make 2 projects to test to, first project (prjTesLV) is a form with a ListView object (LVTes).
Here is its code:
Code:
Private Sub Form_Load()
Dim i as integer
With LVTes
.View = lvwReport
.ColumnHeaders.Add , , "Column 1"
.ColumnHeaders.Add , , "Column 2"
.ColumnHeaders.Add , , "Column 3"
For i = 1 To 20
.ListItems.Add 1, Key:="", Text:="Data 1 Num " & i
.ListItems(1).ListSubItems.Add , , "Data 2 Num " & i
.ListItems(1).ListSubItems.Add , , "Data 3 Num " & i
Next i
End With
End Sub
Properties of form:
Name : frmTesting
Caption : Testing
Now, lets compile that project to .exe file --> results Testing.exe
---
OK, the second is a form with command button and a module.
Here is the module code:
Code:
Option Explicit
Private Const LVM_FIRST As Long = &H1000
Private Const LVM_DELETECOLUMN As Long = (LVM_FIRST + 28)
Public Const LVFI_PARAM As Long = &H1
Public Const LVIF_TEXT As Long = &H1
Public Const LVFI_STRING = &H2
Public Const LVFI_PARTIAL = &H8
Public Const LVFI_WRAP = &H20
Public Const LVFI_NEARESTXY = &H40
Public Const LVM_DELETEITEM = (LVM_FIRST + 8)
Public Const LVM_FINDITEM As Long = (LVM_FIRST + 13)
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function EnumChildWindows Lib "user32.dll" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private Declare Function GetClassName Lib "user32.dll" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Type LV_FINDINFO
flags As Long
psz As String
lParam As Long
pt As POINTAPI
vkDirection As Long
End Type
Dim iIndex As Long, tLVFI As LV_FINDINFO
Private Function EnumChildProcedure(ByVal hwnd As Long, ByVal lParam As Long) As Long
Dim zClassName As String, a As Long
zClassName = Space$(256)
GetClassName hwnd, zClassName, 256
a = InStr(1, zClassName, Chr$(0), vbBinaryCompare) - 1
If a < 0 Then a = 0
zClassName = Left$(zClassName, a)
If LCase$(zClassName) = LCase$("ListView20WndClass") Then
tLVFI.flags = LVFI_PARTIAL
tLVFI.psz = "Data 1 Num 17"'Lets say to find "Data 1 Num 17"
'''''try to delete''' iIndex = SendMessage(hwnd, LVM_DELETEITEM, ByVal 3&, ByVal 0&)
iIndex = SendMessage(hwnd, LVM_FINDITEM, -1, tLVFI)
End If
EnumChildProcedure = 1
End Function
Public Sub FindItemFromLV()
Dim hwnd As Long
hwnd = FindWindow(vbNullString, "Testing")'"Testing" is the caption of frmTesting of prjTesLV (first project above)
If hwnd <> 0 Then EnumChildWindows hwnd, AddressOf EnumChildProcedure, ByVal 0&
End Sub
The form code:
Code:
Private Sub Command1_Click()
FindItemFromLV
End Sub
Now, we run Testing.exe (first project) and run this second project.
When click on command button Command1, an error (looks like system error) occured says something like this:
prjTesLV has encountered a problem and needs to close. We are sorry for the inconvenience.
I guess, it's because of the LVM_FINDITEM doesn't work. Cause' when I use the LVM_DELETEITEM (at row '''''try to delete''''')
and not to use LVM_FINDITEM, it's really work (by delete the 3rd row of the ListView LVTes of Testing.exe).
Anybody can explain this kind of error? And how to make the LVM_FINDITEM works?
Thanks for any reply!
ListView FindItem Question
I have 2 list view’s and both have 3 fields
LvInv1 and lvAll2
First field is ID, second field is Qty, and third is a date.
What happens is lvInv1 Qty is taken out of and moved into lvAll2 listview. So the Qty In lvInv1 goes down and Qty in lvAll2 goes up.
So when I remove a single row in LvAll2, whats supposed to happen is, the qty from lvall2 is remove and the qty lvinv1 should be updated (lv1 +lv2) now all this depends on which ID is picked.
I have looked over a few listview tutorials but none seem to work.
Any help would be appreciated.
Thank you
FindItem Remove - ListView
I am wanting to remove the found item but so far i cant seem to get it to work..
VB Code:
Set lItem = Form.lstUsers.FindItem("string")If Not lItem Is Nothing Then lItem.Selected = True lItem.Remove lItem.IndexEnd If
I have also tried lItem.Remove (lItem.SelectedItem) and lItem.Remove by its self but still no success!
It is a very simple problem i know just i cant get it to work
ListView .FindItem Not Working Why???
This is the Code i have put into a form
Code:
Dim li As ListItem
Set li = ListView1.FindItem(Text1.Text, lvwText, , lvwPartical)
If Not li Is Nothing Then
li.Selected = True
li.EnsureVisible
MsgBox "Search Completed"
End If
what is wrong? It does not do anything. PLease help
*ListView1 has been set to Report. "lvwReport"
Listview FindITEM Problem
Dim itm As ListItem
Set itm = ListView2.FindItem("Hey", lvwText)
MsgBox itm.Index
what is wrong with that? i searched the forum and found this code to search a listview for text. i get an "object variable or with block variable not set" error and it points to "MsgBox itm.Index"
Listview Finditem By Column
Hail,
Is it possible to use FindItem from a listview control but restricting the search to a specific column? With the code I got in these forums and in the help files, it only searches in the first column, I want it to search in a column I specify. I guess I could loop through each item and use subitems but I wanted to validate if there wasn't an easier way before doing that
Thanks
Phailak
Listview.finditem Function
Please help - how do I use the function ListView.FindItem?
and what is the object type that will receive the result of the find?
I would appriciate an example code.
Thanks
ListView FindItem Method
I'm checking to see if an item exists in a ListView prior to adding it.
How can I check if the FindItem method of a ListView control DID NOT find anything. I'm using the following statements.
VB Code:
Set CurItem = ListView1.FindItem("text", lvwText, 1, lvwWhole)
I know that CurItem = Nothing if FindItem doesn't find anything.
But how do I check that?
The following doesn't work...it seems to be invalid
VB Code:
If CurItem = Nothing Then
help appreciated.
Cedric
ListView FindItem True
I got a ListView and im trying to find an item in lv,
and i want it to make if its true msgBox "Founded."
and if its False to MsgBox "Error: No such item."
Thnx
Edited by - ProDan on 8/18/2004 2:40:07 PM
FindItem In Listview Control
Hi People,
I've seen several ways of using the FindItem method in the ListViewControl (also using the API), but nobody mentions the problem I'm having : FindItem locates the correct item and highlights it, but the found item does not get into the 'visible' part of the control, so I need to use the scrollbar to go up or down and find the highlighted (found) item.
Am I not setting a property, or what am I missing ?
Regards,
AlexC
Listview.FindItem - Multiple Results?
I'm using Listview.FindItem to locate items in a listview. The problem is, what if there are more than 1 match to my search string. how can .finditem return multiple results???
Thanks!
Using FindItem To Search Through Subitems In A Listview
I'm trying to add search functionality to values in a listview. The search should be able to search on an entered value & search through subitem(1) only and NOT all subitems. I can't get it to do this at all & the lvwTag thing isn't playing game at all. How would I limit the search to ONLY the first subitem?
The code I have in the finditem statement is :
set lsiItem = lsvStaffList.FindItem(strSearchSurname, lvwSubItem, 1, lvwPartial)
Any thoughts?
Cheers
Colin
Finding More Than One Record With Listview Finditem
I need to be able to find all occurances of an employee that is listed in a listview control. I have been able to find the first record, but if it is not the one needed, I want the user to be able to click a command button to goto the next matching record. With previous help, this is my code:
Dim itmItem As ListItem
Set itmItem = lv.FindItem(ZOUT$, 1)
itmItem.Selected = True
itmItem.EnsureVisible
Search Facility Like In Vista! But With ListView.FindItem
Hello,
Im trying to create a search facility like the one in vista's start menu.
Im trying to figure our the listview.finditem and how it works.
Kind of figured it out, but not fully.
Any suggestions on how i can achieve this with a listview?
Basically as you type a letter what ever is in the listview, gets filtered and if
there is any similar match found, items get left behind, else they get removed.
Select FindItem Text In ListView: Nearly Resolved
I have a form with a listview in it and when i put in a search fo a specific Item, it will not select the Item i want. The code i have is this:
Code:
Dim li As ListItem
Set li = ListView1.FindItem(Text1.Text, lvwText, , lvwPartial)
If Not li Is Nothing Then
li.Selected = True
li.EnsureVisible
End If
*My ListView is selected to report view
Using Listview.finditem To Remove Duplicate Files....
I was wondering how to use the listview.finditem before loading items into the list, then form an if statement on either not adding if it is allready there and adding if it isn't..... can anyone tell me how this is done? or if there is an easier way to prevent duplicate items plz let me know, thanks
Listview, Search Result To Top.
How can i get the first result of a search in a listview always on the top possition in the listview?
frmMain.lvMain.ListItems(i).Selected = True
frmMain.lvMain.ListItems(i).EnsureVisible 'make sure it's visible
this code bit i already use, but that will only make sure that the found (selected) item is visible in the listview and is placed low in the listview...
Tnx in advance
Searching From A Db And Displaying The Result In A Listview
Below is my code that i couldn't get it working, there's no error messages but nothing happens. What i intend to do is , search from an access97 database and display it in a listview. Next when the user double clicks the result or selects it and clicks OK (button) it displays all the record in another form. Can anyone help me or show me some examples ?, Thanking you guys and girls in advance.
Code:
Public SDb As Database
Public SRc As Recordset
Public Search_Sql As String
Public lvHeader As ColumnHeader
Public lvListItems As ListItem
--------------------------------------------------------------
Private Sub cancel_Click()
Me.Hide
End Sub
----------------------------------------------------------------
Private Sub Form_Load()
Call Load_LV_Header
search.Text = ""
End Sub
---------------------------------------------------------------
Private Sub cari_Click() <---- The Code When I click the Search button
Dim Tmpfind As String
On Error Resume Next
Search_Sql = ""
Tmpfind = ""
Tmpfind = Trim(search.Text)
If Len(Tmpfind) < 1 Then
MsgBox "You need to enter search value"
Exit Sub
Else
Search_Sql = "SELECT description, plu FROM drugs Where description = '" & Tmpfind & "'"
End If
Set SDb = OpenDatabase(App.Path & "ims1.mdb", False, False)
Set SRc = SDb.OpenRecordset(Search_Sql)
If SRc.RecordCount > 0 Then
SRc.Fields.Refresh
Do While Not SRc.EOF
ListView1.ListItems.Clear
lvListItems.SubItems(0) = SRc.Fields("description")
lvListItems.SubItems(1) = SRc.Fields("plu")
SRc.MoveNext
Loop
End If
End Sub
-------------------------------------------------------------------------
Private Sub Load_LV_Header()
ListView1.ListItems.Clear
Set lvHeader = Nothing
Set lvHeader = ListView1.ColumnHeaders.add(, "C1", "Description", 2000, lvwColumnLeft)
Set lvHeader = ListView1.ColumnHeaders.add(, "C2", "PLU", 2000, lvwColumnLeft)
End Sub
How To Display Stored Procedures Result In ListView?
Hello! Does anybody know how to display a stored procedure result in listview?
I have this in my code:
Dim li As ListItem
Set cmdActLog.ActiveConnection = connActLog
Set rstActLog = cmdActLog.Execute
li.SubItems(2) = rstActLog
But I"ve got an error that says type mismatch. Any idea?
Thanks!
How To Load Data From ListView Search Result?
i already done the search function for listview for any particular data. Then i tried to take that data to another form so that the details will come up at the neew form. (For example, i search for staff ID "001", then i checked the checkbox, after that i wanna press OK button so that the details information about "001" will be fill up into 'staff details information page').
The database that been used was SQL Server. I really dont have any idea how to do and i tried search at the internet but failed. Can U guys help me out? Thanks Guys..!!!
[Read] Need Help With Custom Scrollbars On A Listview Control! Or Skinning Listview..
I have been searching for weeks now to find a way to use a custom scrollbar to scroll a listview...
Like this:
Now I use an alternating BG function on my listview and I am currently using the ensurevisible method of scrolling a listview...
Is there a better way?
I will post some example projects if needed...
But how would I use a custom scrollbar on a listview control
Thanks for helping
2 ListView Questions. 1 About Selecting Records. 2 About Adjusting Listview Box Size.
Hi,
I'm changing some of my programs to use a ListView instead of a ListBox.
1. On selecting a record how do I pass the info from the fifth column to another Sub? (I have .FullRowSelect = True)
2. I'm dynamically adjusting the column widths to the maximum length of the data going into the column. Is there a way to dynamically adjust the width of the listview box itself to be the sum of the column widths?
Thanks,
Al.
How To Compare 2 Listviews And Copy Listview Content To Another Listview?
Hi all. I am filling a listview with xml data as shown in code beleow. I am calling this part using timer.What i want at the end of this code to compare listview1 with listview2. If they are diffrent or if listview2 is empty then i copy content of listview1 to listview 2.Otherwise do nothing. could any one show me how i can make such compare an copy?Thanks
1 Code:
Dim objDoc As MSXML2.DOMDocument
Dim objNodelist As IXMLDOMNodeList
Dim objNode As IXMLDOMNode
Dim lvwItem As ListItem
'load the xml document
Set objDoc = New MSXML2.DOMDocument
objDoc.async = False
objDoc.Load "http://localhost/data.php"
'add all the song nodes into a nodelist
Set objNodelist = objDoc.selectNodes("//song")
'Clear the listview
ListView1.ListItems.Clear
'Loop through each song node and add to the list view
For Each objNode In objNodelist
Set lvwItem = ListView1.ListItems.Add(, , objNode.selectSingleNode("artist").Text)
lvwItem.SubItems(1) = objNode.selectSingleNode("name").Text
lvwItem.SubItems(2) = objNode.selectSingleNode("image").Text
lvwItem.SubItems(3) = objNode.selectSingleNode("rating").Text
lvwItem.SubItems(4) = objNode.selectSingleNode("songid").Text
lvwItem.SubItems(5) = objNode.selectSingleNode("totalvotes").Text
Next objNode
''Here i want to compare listview1 with listview2. If it is empty or diffrent if fill it
otherwise i do nothing.
Set lvwItem = Nothing
Set objNodelist = Nothing
Set objDoc = Nothing
Moving A Listview Item And Its Subitems To A New Listview
Hey Guys,
Having a bit of trouble. I am attemping to move a selected item and its subitems from one listview to another. I have no problem getting the contents of the first column, but I can't seem to get the subitems over.
Example: I have this in the first listview:
Code:
|Item |Quanity|Price |PQ |
Bananas 2 $.50 $1.00
Then when I try to move that whole row to the other listview I can only seem to get this:
Code:
|Item |Quanity|Price |PQ |
Bananas
No subitems . Any links or help would be appreciated.
Regards,
Max_Power
Listview.Add No Longer Recognize? Listview.mscomctllib Instead?
So I hadn't done some Vbasic coding in like a month. Then i go to edit my code and find the debugger throwing an error on my listview.add.
I delete the .add and hit the . key to see what the supported methods are and it only shows "MSComctlLib" as my option. But then it throws an error when i try to select that. How did this happen and more importantly how do I get back to normal listview methods?
Listview; Getting Data (populate Listview) From 2 Tables??
hi!
im using a listview of my program..
where i need popluate the it with data coming from 2 tables, (table 1 and table 2); and where one of the entities in both table are the same...
for instance;
table 1 = stud_genInfo
table 2 = stuf_Offenses
both has the entity= stud_Number..
in which i need to show the stud number in my listview..
how can set (code) to show the Stud_no.?? confused:
can anyone help me with this one?? pls i need ur help, badly...
i would appreciate all the help/suggestions anyone would give..
mauve
-----
btw, this is a snip of my code:
strToday = Format (now, "mmddyyy")
With rsSearch
.Open "SELECT * FROM GenIndo, Offenses WHERE Schedule.Date_Today = '" & strToday & " ' And Schedule.Stud_No =CheckUp.Stud_No", CN, adOpenStatic, adLockPessimistic
If .RecordCount <= 0 Then
lvwSchedule.ListItems.Clear
Else
lvwSchedule.ListItems.Clear
.MoveFirst
Do Until .EOF
Set xlist_item = lvwSchedule.ListItems.Add(, , !Stud_NO) ' this is the line(part) where VB highlights the error
xlist_item.ListSubItems.Add , , (UCase(!Last_Name) & ", " & !First_Name & " " & !Middle_Name)
xlist_item.ListSubItems.Add , , (!Offense)
xlist_item.ListSubItems.Add , , (!Offense_Type)
xlist_item.ListSubItems.Add , , (!Offense_No)
.MoveNext
Loop
End If
.Close
End With
Set rsSearch = Nothing
-------
thank u so much...:
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
Listview Problem; Listview.selecteditem
So, I have a listview that displays a series of things, and refreshes every 10 seconds. (By refresh, I mean it clears itself and re-fills all info from a database)
When it refreshes, I want to check and see if any message was selected before the refresh, and if so, select it again.
Code:
'select nothing...GRRRRrr
For i = 1 To frmQuickCom.lstMessages.ListItems.Count
frmQuickCom.lstMessages.ListItems(i).Selected = False
Next
'Reselect the originally selected item
'if there are
Select Case SelText 'this is passed in when this sub is called'
Case ""
'if there are no messages, don't select any
If frmQuickCom.lstMessages.ListItems.Count > 0 Then
frmQuickCom.lstMessages.SelectedItem.Selected = False
End If
Case Else 'something was selected
For i = 1 To frmQuickCom.lstMessages.ListItems.Count
If SelText = frmQuickCom.lstMessages.ListItems(i).Text Then
Set frmQuickCom.lstMessages.SelectedItem = _
frmQuickCom.lstMessages.ListItems(i)
frmQuickCom.rtfMessage.Text = strMsgTransfer
frmQuickCom.lstMessages.SelectedItem.EnsureVisible
End If
Next
'move the window to show the selected item
End Select
So here's the problem -- even if I set selecteditem.selected = false, Selecteditem still has a value. Is there anyway to actually clear that value entirely? (The reason why I ask -- if a message is deleted, it is leaving the last added item (in the next refresh) as the 'selected' item, even though it gets set to false. If I try to key off of the selecteditem value, then, it returns something.)
Drag Listview, Target Is The Same Listview
Hello,
I would like to let the user set a priority on listviewitems by multiple selecting them and dragging them to the correct priority.
So.. I would like to drag and drop a multiple selection and the target is the same listview.
I hope this makes sence.
patrick.
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
Drag And Drop From Listview To Another Listview
Hey Guys,
I've think i've tried everything but cant get it to work. I can get it to work to a text box or a list bow but not to another Listview!!
Anyone know how to drag the contents of a listview to another listview??
b
|