Article View: microsoft.public.win32.programmer.ui
Article #2Re: How do I get a particular item to be visible in listView?
From: rz
Date: Fri, 06 Apr 2001 13:15
Date: Fri, 06 Apr 2001 13:15
46 lines
2802 bytes
2802 bytes
I think you are asking for a way to scroll the listview until a particular item is visible. I don't use listviews, so I'm not sure about the relevance of my experience with listboxes, but no one has given you a "real" answer, so: I suspect a message called LVM_SETTOPINDEX (or corresponding macro in windowsx.h) will let you specify which line should be at the visible range. If so, you can pick a line a "little" (however you want to define "little") above the line you want visible. I'm not happy with my explanation; I really think it is easier to do than to describe. -- ----------------------------------------- To reply to me, remove the underscores (_) from my email address. Robert E. Zaret PenFact, Inc. 46 Beach Street Boston, MA 02111 www.penfact.com Brian Ellis wrote in message ... >I am looking for a way to get a particular item to be visible in a WinAPI >listview control. > >I've tried using a sendmessage with LVM_ENSUREVISIBLE. This appears to >repaint the >listview, with the appropriate item near the top (but unselected), but the >items appear out of order >(they were in alphabetic order before), and another instance of the >pertinent item appears lower in the >list, this time selected(highlighted). > >I've also tried using a sendmessage with LVM_SCROLL. I use LVM_GETTOPINDEX >before the call to >scroll, which typically returns item index 0. After the LVM_SCROLL call >(which returns True, indicating success), another LVM_GETTOPINDEX call >returns item index 0, and no scrolling has taken place. > >Can anyone suggest anything? > >Thanks in advance, >Brian Ellis > > >
Technical Details
Message-ID:
<GBDHuJ.68J@world.std.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.umass.edu!world!newsReferences:
<hGHy6.107$kg.2395@news2.mts.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1091e5,282e27e37b2ad713 X-Google-Attributes: gid1091e5,public X-Google-Thread: 10461f,282e27e37b2ad713 X-Google-Attributes: gid10461f,public X-Google-Thread: f7033,282e27e37b2ad713 X-Google-Attributes: gidf7033,public X-Google-Thread: 110c1b,282e27e37b2ad713 X-Google-Attributes: gid110c1b,public X-Google-ArrivalTime: 2001-04-06 06:40:00 PST Newsgroups: microsoft.public.win32.programmer.ui,microsoft.public.win32.programmer,comp.os.ms-windows.programmer.controls,borland.public.delphi.winapi Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.umass.edu!world!news From: "rz" <r_zaret@pen_fact.com> Subject: Re: How do I get a particular item to be visible in listView? X-Mimeole: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: <GBDHuJ.68J@world.std.com> Date: Fri, 6 Apr 2001 13:15:16 GMT References: <hGHy6.107$kg.2395@news2.mts.net> NNTP-Posting-Host: ppp0b185.std.com Organization: The World @ Software Tool & Die X-Newsreader: Microsoft Outlook Express 4.72.3110.5 Lines: 48