Quick Find in List view

HI All

Is there any way to find subitem in ListView with out using loop

Tahkns
Amrit 


0
Amrit
12/3/2009 7:58:14 AM
vb.general.discussion 1016 articles. 0 followers. Follow

5 Replies
797 Views

Similar Articles

[PageSpeed] 11

"Amrit" <cadd@wlink.com.np> wrote in message 
news:un0Vf5%23cKHA.5796@TK2MSFTNGP06.phx.gbl...
> HI All
>
> Is there any way to find subitem in ListView with out using loop

If you used "Key" parameter when adding items, you could use it to find 
items quickly, but it's not easy to make it work for multiple columns. 
Example: ListView1.ListItems("Item123"). Collections in VB use an efficient 
method of searching by using hash tables, so finding items this way is fast, 
adding them is slow because the Collection does some indexing to make 
retrieval faster.

Another option is using a virtual ListView. In this case, the items are not 
stored in the ListView, and it only show one screen-full at a time. This 
makes it super fast. You can store your data in an array of UDT, and if you 
want to find an item, just search your array. For a VB6 sample, search this 
page for "Virtual ListView Demo.zip (19KB)".

http://www.mvps.org/vbvision/Sample_Projects.htm#CustomDrawLV_Demo

There is a different sample with similar name, "Virtual Listbox Demo.zip 
(34KB)". This is not the same sample.


0
Nobody
12/3/2009 8:30:55 AM
"Amrit" <cadd@wlink.com.np> wrote in message 
news:un0Vf5%23cKHA.5796@TK2MSFTNGP06.phx.gbl...
> HI All
>
> Is there any way to find subitem in ListView with out using loop
>
> Tahkns
> Amrit

Have a look at the messages: LVM_FINDITEMA & LVM_FINDITEMW
http://msdn.microsoft.com/en-us/library/bb774903(VS.85).aspx

It's not one I've used myself but it does not look too tricky, first fill a 
LVFINDINFO (http://msdn.microsoft.com/en-us/library/bb774745(VS.85).aspx) 
structure, then send the message with SendMessage. It should either return 
the index of the containing listitem or -1 if no match is found.

BTW it's really quite easy to find these, I keep a copy of COMMCTRL.H and I 
just glance through the values starting with LVM_ (List View Message) until 
I find one that sounds like it might do what's needed, then use Google to 
find the documentation at MSDN and read that then either have a go or return 
to Google to hunt down some examples. The same principle obviously applies 
to all intrinsic controls although you'll need the correct header file for 
other controls (WINUSER.H has a lot).

You'll notice that many messages that deal with strings have "A" and "W" 
versions, basically the W (wide) one is for unicode.

Regards
Dave O.


0
Dave
12/3/2009 11:25:23 AM
Hi Dave

Thanks you both for Respond.



Well, I don't know much about winapi. is that possible to tell me where can 
i get example for  LVM_FINDITEMA & LVM_FINDITEMW


for  VB. and how to apply it.

I search in Google. But result is not good for me.

I really appreciate your input. Thanks.

Thanks for help.

Amrit



"Dave O." <nobody@nowhere.com> wrote in message 
news:ezTdLtAdKHA.4880@TK2MSFTNGP05.phx.gbl...
>
> "Amrit" <cadd@wlink.com.np> wrote in message 
> news:un0Vf5%23cKHA.5796@TK2MSFTNGP06.phx.gbl...
>> HI All
>>
>> Is there any way to find subitem in ListView with out using loop
>>
>> Tahkns
>> Amrit
>
> Have a look at the messages: LVM_FINDITEMA & LVM_FINDITEMW
> http://msdn.microsoft.com/en-us/library/bb774903(VS.85).aspx
>
> It's not one I've used myself but it does not look too tricky, first fill 
> a LVFINDINFO 
> (http://msdn.microsoft.com/en-us/library/bb774745(VS.85).aspx) structure, 
> then send the message with SendMessage. It should either return the index 
> of the containing listitem or -1 if no match is found.
>
> BTW it's really quite easy to find these, I keep a copy of COMMCTRL.H and 
> I just glance through the values starting with LVM_ (List View Message) 
> until I find one that sounds like it might do what's needed, then use 
> Google to find the documentation at MSDN and read that then either have a 
> go or return to Google to hunt down some examples. The same principle 
> obviously applies to all intrinsic controls although you'll need the 
> correct header file for other controls (WINUSER.H has a lot).
>
> You'll notice that many messages that deal with strings have "A" and "W" 
> versions, basically the W (wide) one is for unicode.
>
> Regards
> Dave O.
>
> 


0
Amrit
12/3/2009 4:28:39 PM
Well I used Google with this:
LVM_FINDITEM VB -net
and got loads of hits, granted most were junk but this one:
http://forums.devx.com/archive/index.php/t-153973.html
had something useful about half way down the page

Incidentally, have you tried the ListView built in FindItem command?
If you don't want to read a ListView in a different application then the 
native command should be adequate.

Regards
Dave O.

"Amrit" <cadd@wlink.com.np> wrote in message 
news:%23RxxsWDdKHA.2188@TK2MSFTNGP04.phx.gbl...
> Hi Dave
>
> Thanks you both for Respond.
>
>
>
> Well, I don't know much about winapi. is that possible to tell me where 
> can i get example for  LVM_FINDITEMA & LVM_FINDITEMW
>
>
> for  VB. and how to apply it.
>
> I search in Google. But result is not good for me.
>
> I really appreciate your input. Thanks.
>
> Thanks for help.
>
> Amrit
>
>
>
> "Dave O." <nobody@nowhere.com> wrote in message 
> news:ezTdLtAdKHA.4880@TK2MSFTNGP05.phx.gbl...
>>
>> "Amrit" <cadd@wlink.com.np> wrote in message 
>> news:un0Vf5%23cKHA.5796@TK2MSFTNGP06.phx.gbl...
>>> HI All
>>>
>>> Is there any way to find subitem in ListView with out using loop
>>>
>>> Tahkns
>>> Amrit
>>
>> Have a look at the messages: LVM_FINDITEMA & LVM_FINDITEMW
>> http://msdn.microsoft.com/en-us/library/bb774903(VS.85).aspx
>>
>> It's not one I've used myself but it does not look too tricky, first fill 
>> a LVFINDINFO 
>> (http://msdn.microsoft.com/en-us/library/bb774745(VS.85).aspx) structure, 
>> then send the message with SendMessage. It should either return the index 
>> of the containing listitem or -1 if no match is found.
>>
>> BTW it's really quite easy to find these, I keep a copy of COMMCTRL.H and 
>> I just glance through the values starting with LVM_ (List View Message) 
>> until I find one that sounds like it might do what's needed, then use 
>> Google to find the documentation at MSDN and read that then either have a 
>> go or return to Google to hunt down some examples. The same principle 
>> obviously applies to all intrinsic controls although you'll need the 
>> correct header file for other controls (WINUSER.H has a lot).
>>
>> You'll notice that many messages that deal with strings have "A" and "W" 
>> versions, basically the W (wide) one is for unicode.
>>
>> Regards
>> Dave O.
>>
>>
>
> 


0
Dave
12/3/2009 4:44:33 PM
Hi Dave

Thanks i think it will work for me.
thanks for your help
Amrit


"Dave O." <nobody@nowhere.com> wrote in message 
news:uyl$hfDdKHA.4780@TK2MSFTNGP04.phx.gbl...
> Well I used Google with this:
> LVM_FINDITEM VB -net
> and got loads of hits, granted most were junk but this one:
> http://forums.devx.com/archive/index.php/t-153973.html
> had something useful about half way down the page
>
> Incidentally, have you tried the ListView built in FindItem command?
> If you don't want to read a ListView in a different application then the 
> native command should be adequate.
>
> Regards
> Dave O.
>
> "Amrit" <cadd@wlink.com.np> wrote in message 
> news:%23RxxsWDdKHA.2188@TK2MSFTNGP04.phx.gbl...
>> Hi Dave
>>
>> Thanks you both for Respond.
>>
>>
>>
>> Well, I don't know much about winapi. is that possible to tell me where 
>> can i get example for  LVM_FINDITEMA & LVM_FINDITEMW
>>
>>
>> for  VB. and how to apply it.
>>
>> I search in Google. But result is not good for me.
>>
>> I really appreciate your input. Thanks.
>>
>> Thanks for help.
>>
>> Amrit
>>
>>
>>
>> "Dave O." <nobody@nowhere.com> wrote in message 
>> news:ezTdLtAdKHA.4880@TK2MSFTNGP05.phx.gbl...
>>>
>>> "Amrit" <cadd@wlink.com.np> wrote in message 
>>> news:un0Vf5%23cKHA.5796@TK2MSFTNGP06.phx.gbl...
>>>> HI All
>>>>
>>>> Is there any way to find subitem in ListView with out using loop
>>>>
>>>> Tahkns
>>>> Amrit
>>>
>>> Have a look at the messages: LVM_FINDITEMA & LVM_FINDITEMW
>>> http://msdn.microsoft.com/en-us/library/bb774903(VS.85).aspx
>>>
>>> It's not one I've used myself but it does not look too tricky, first 
>>> fill a LVFINDINFO 
>>> (http://msdn.microsoft.com/en-us/library/bb774745(VS.85).aspx) 
>>> structure, then send the message with SendMessage. It should either 
>>> return the index of the containing listitem or -1 if no match is found.
>>>
>>> BTW it's really quite easy to find these, I keep a copy of COMMCTRL.H 
>>> and I just glance through the values starting with LVM_ (List View 
>>> Message) until I find one that sounds like it might do what's needed, 
>>> then use Google to find the documentation at MSDN and read that then 
>>> either have a go or return to Google to hunt down some examples. The 
>>> same principle obviously applies to all intrinsic controls although 
>>> you'll need the correct header file for other controls (WINUSER.H has a 
>>> lot).
>>>
>>> You'll notice that many messages that deal with strings have "A" and "W" 
>>> versions, basically the W (wide) one is for unicode.
>>>
>>> Regards
>>> Dave O.
>>>
>>>
>>
>>
>
> 


0
Amrit
12/3/2009 9:29:50 PM
Reply:

Similar Artilces:

find & return value
My first spreadsheet is a calendar of sorts with date in one column and value in next. Dates for different months are in different columns, so we have: Date (Jan)| Value| Date (Feb)| Value| Date (Mar)| Value| etc. My second spreadsheet references this "calendar" but the layout is not the same at all (so lookups probably can't work?). In this spreadsheet, I have a list of various dates from different months. What formula can I use to return the corresponding value for the date, based on the source info in my first spreadsheet? Sounds right for VLOOKUP to me. Layout is im...

Tree View Control state image list
I'm trying to implement a tree view in an MFC wizard property sheet that has check boxes that can be dimmed. In order to do this, I've created an image list that has the check boxes in each of their 4 possible combinations of unchecked/checked and enabled/disabled (as well as a blank image at index 0). However, when I set this image list as the tree view control's state image list, all I see are blank images where the check boxes should be. (I use the correct state indices when I add the various items. I'm using commctl32 version 5.80 and Visual Studio 2005, so according...

Multicurrency costing, list price
I have a new client using multicurrency. Their functional currency is Canadian dollar Below is his question... How do I record standard costs is USD when base currency is CAD? I need to report on the purchase variance and our standards are in USD as well as our purchases are based in USD. I'm not sure even where to start with multicurrency and inventory pricing, costing, etc. I know on the item you can assign a currecny ID to the List price but not to cost. So, will he use the PO to enter US currency ID when purchasing items? Thanks for any help. TracyM I have never tried this ...

List of records >10 days old
Hi Everyone, I am using Access 2003. I want a list of patients who are active and have been on therapy >10 days as well as a field that shows how many days they have been on therapy. I have a tblPatients and a tblTherapy with the fields I need. I created a query joining these 2 tables and only showing active patients with LastName, FirstName, AdmNum and their ThpyStDtTm. The active field is Y/N in my tblPatients. Once I get only the records >10 days old, I need another field that gives me the total days the patient has been here. Thanks, Linda On Mon, 1...

alphabetizing by first letter of exisitng list in Word 2007
Is there a way to cause an existing list to be organized by the first letter of each line of the list? On Jan 1, 11:12=A0am, jakson <jak...@discussions.microsoft.com> wrote: > Is there a way to cause an existing list to be organized by the first let= ter of > each line of the list? =A0 Yes. You just asked 7 minutes earlier. Yes. See: http://gregmaxey.mvps.org/Sorting_Lists_(Macro_methods).htm for some macro methods. jakson wrote: > Is there a way to cause an existing list to be organized by the first > letter of each line of the list? Probably ov...

E-mail option replaced by Mail Recipient as Text-Quick Access Tool
I no longer have the E-mail option on the Quick Access Toolbar. This has been replaced by the Mail Recipient (as Text) option instead. Even when I select E-mail from the Customize Quick Access Toolbar options or through the More Commands option, Word will still automatically converts the E-mail option to Mail Recipient (as Text). When I click on the Office Button and select Send, I still only have the option for Mail Recipient (as Text). The only way for me to send a Word doc as an attachment is to use the Send for Review option, which I don't want to do since it automati...

Re: Conflicting views
Thanks for all the replies, will keep for reference. Looks like usenet death of this group has already started for me, as I cannot see my original post or replies at all in here. I only found the post and replies after using google-groups; never had this problem before. (Will post this here as its obvious others can see my post.) Ed Eddie wrote: > Thanks for all the replies, will keep for reference. > > Looks like usenet death of this group has already started for me, as I > cannot see my original post or replies at all in here. > I only found the post and r...

Ability to view/track Attendee response
Hi, Is there a way for an attendee to view/track other attendee's responses to a meeting witout being an organizer? If not, can there be multiple organizers? I am using Outlook 2003. Thanks, Debraj No. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Debraj asked: | Hi, | | Is there a way for an attendee to view/track other attendee's | responses to a meeting witout being an organizer? If not, can there | be multiple or...

Unable to view a specific public folder
I have a user who is unable to view a certain public folder in the public folder list. Permissions are setup correctly and other users can view the entire list of public folders. She is not setup to be denied any type of access at the public folder level. Any ideas? Exchange 2003 Outlook 2003 In Outlook, when you right click the public folder, go to properties and go to the summary tab, what permission level are you granted? James Chong MCSE + Messaging, MCTP msexchangetips.blogspot.com jasons9745 wrote: > I have a user who is unable to view a certain public folder in the public >...

view changes as I make them without print preview
Please can someone explain how I can view the changes I make to a publication "live" without having to keep going to print preview. I can see changes to text but nothing else i.e colour of background, textures and shape colour and lines. I am using windows XP home edition crazyk.2007 wrote: > Please can someone explain how I can view the changes I make to a publication > "live" without having to keep going to print preview. I can see changes to > text but nothing else i.e colour of background, textures and shape colour and > lines. Read http://ed.mvps.or...

Money Plus 08
I'm having trouble setting up online services in Money Plus 08. I finally got through the upgrade, but every time I try to download a list os available Banks & Brokerages I get a message that the list is Temporarity Unavailable....it's been Temporarily unavailable for the better part of the last week. Anyone have any ideas on if I'm missing something or, if it is unavailable, when it will be available? ...

View records option
Hi Everyone, I have a patient database. My main form is based on my patients table. A subform on my main form has Pt. location which has the fields Area, Room number and bed number. How can I set something up so they can search for a patient by room number? I don't want to use any code. I need some ideas/options for this. Thanks, Linda SHUUUUT UUUUP! I liked the last suggestion and then tried it. That is the coolest thing ever. You guys are really great! Thank-you, Linda "Trever B" <TreverB@discussions.microsoft.com> wrote in message news:DD22722D-...

Removing, Hiding Public and System Defined Views in 4.0
Does anyone know how to either remove or hide, Public and System Defined Views in 4.0? For example nobody wants to see "Accounts: No Campaign Activities in Last 3 Months" or "Accounts: Responded to Campaigns in Last 6 Months" Also, I have yet been able to see how you share views in 4.0 Thank you for the help! ...

DPM cannot find volume/partiton on a protected Windows 2008 server
Hi, I'm having trouble finding a partition on a remote file server and adding some folders from the partition to a Protection Group on a DPM 2007 sp1 server. I have already tried reinstalling the DPM agent on the remote computer, patching DPM 2007 to the latest hotfix package, searching the internet for a similar problem and I cannot find a solution for this. The server that I'm trying to protect is a windows server 2008 file server that has 2 volumes. This is a Intel Modular Server that is connected to a Promise e310s storage. One volume is on the Intel Modular Server...

How does page navigation buttons help me view a publication?
How does page navigation buttons in Publisher help me view a publication? Rebecca <Rebecca@discussions.microsoft.com> was very recently heard to utter: > How does page navigation buttons in Publisher help me view a > publication? They don't, unless you export to a website. If you export to a website, you don't get Publisher's page buttons at the bottom of the screen, so you need a page navigation bar. -- Ed Bennett - MVP Microsoft Publisher ...

How to prevent viewing of workbook
Ladies and Gentlemen: I cannot determine via Help for Excel 2000 how to prevent the viewing (display) of a xls workbook upon opening the file. This is NOT a shared workbook. I want to be the only person to view and edit this file. It has three worksheets; they're not grouped. Surely there's a solution as simple as preventing the opening of a WORD document: set a password and upon opening the document, before the display of the file contents, the user is prompted for a password (which only I know of course). In Word this protection is retained from each save/close to each reopen...

Find Available Times
I'm trying to limit resource availability to true work hours of 6 AM to 5 PM, while also having Services that span 1+ days. Is Scheduling Engine functionality capable of Finding Available Times for Resources that do not have consecutive availability of more than 12 hours? What happens now is that if I don't have resource availability of All Day, the Scheduling Engine returns a result of "No results found. Try choosing..." ...

Clear recent items list
Hi, It's easy to set options to show/not show or to clear the recent items list in Word, etc. But how do I do that in Publisher 2007, please? Thanks, Robert I suspect it would take a registry fix. I'm not sure how many recent open publications is the default. In the registry it appears to be 9. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Robert" <Robert@discussions.microsoft.com> wrote in message news:27659C2C-FA43-4988-A18C-733C010BBC5D@microsoft.com... > Hi, > > It's easy to set optio...

Change sorting order behavior for columns with pick list values
Please change the behavior for sorting anny view for any entity to the label name instead of the value of the label. as Microsoft CRM 3.0 has a bit strange way of the sorting behavior in views for columns with pick list values When in a view (any view for any entity) When a column is a pick list field When I sort the view on the column which is a pick list field The sorting order is not by label name The sorting order is not by order in the pick list The sorting order appears to be on the value belonging to the label result looks to be un-logical ---------------- This post is a suggesti...

Data Validation
Hi World I'm using Excel 97 I have a cell that I want to select a value from a list. The list that I want to select from is on a different worksheet. I've tried using Data Validation, selecting the Stettings Tab and in the allow dialog box chossing select list. But the source dialog will not let me choose any list that is not on the same worksheet. Anyone with a high IQ any ideas on how to achieve this? Hi With validation list, only cell references to same worksheet are allowed. To refer to list on another worksheet in same workbook, you have to define the list as named range...

remove file from most recent files listing
How do you remove the listing of a money file from the recent used files list? It is confusing for the person to see the file listed there when it has been deleted intentionally because it is no longer used. In microsoft.public.money, pk wrote: >How do you remove the listing of a money file from the recent used files >list? It is confusing for the person to see the file listed there when it >has been deleted intentionally because it is no longer used. See http://support.microsoft.com/kb/841213/en-us Solved my own problem. It is located in the registry key under HKCU\softwa...

parameter list for hooks (RMS)
Can someone please post a list of what the various parameter numbers refer to (in relation to using Com object hooks). Thanks. Search the forum for "hook list". It's been answered a couple of times this week. There is a document available from Customer Source now, which I don't think used to be available as it is clearly labelled "Partner Only Article". CustomerSource, Support, Knowledge Base, Retail Management, Store Operations, Customization, you should fine it. ArticleID is 869720. There is a direct link in the post starting 1) Database Schema. I&...

Email view changes
I have a user whose view setting is 'messages' but when she receives a new email, it appears as the message subject and the first few lines of the email in blue. I have launched Outlook with resetfolders but it happened again. We are on Windows & Office 2000. Thanks, katherine She has the AutoPreview feature turned on. Look on the View menu.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Katherine" <jardine4@hotma...

Adding records to Marketing List
Is there any other way to add records (leads, contacts or accounts) to a Marketing List other than through the Advanced Find tool or a Lookup? We have data that isn't in CRM that we use to determine which leads/accounts should be included in a campaign and the ideal solution would be to take a list of leads/accounts and upload them in to the system simply as members of a marketing list. Instead, we have to use the lookup feature to add potentially thousands of accounts to a marketing list. Any thoughts? Hi, Yes you can achive this functionality with help of some customization. If you...

Quick Campaigns & Last Date Included in Campaign
Hi colleagues Do you know what about Last Date Included in Campaign (Customer Attribute) and Quick Campaigns? It seems that QCampaigns do nothing with this field. Is it correct? Is it a bug? Kind Regards ...