ListView Control Sorting Arrow? 
Author Message
 ListView Control Sorting Arrow?

Using VB6.0 and the ListView Control 6.0.

I'm looking to add the "up and down arrows" on the column
headers to show which column is sorted and whether it's
sorted in ascending or decending.

I'm trying to avoid using an ImageList with icons.

I want to get that "standard" windows look.  Open explorer
and change it to Detailed view and you'll see what I'm
talking about.



Mon, 06 Sep 2004 08:52:13 GMT  
 ListView Control Sorting Arrow?


Quote:
> Using VB6.0 and the ListView Control 6.0.

> I'm looking to add the "up and down arrows" on the column
> headers to show which column is sorted and whether it's
> sorted in ascending or decending.

> I'm trying to avoid using an ImageList with icons.

> I want to get that "standard" windows look.  Open explorer
> and change it to Detailed view and you'll see what I'm
> talking about.

Unless being run under XP, these arrow are not "built-in".  I know I
recently saw something regarding XP having these arrows built-in, but I
can't remember if it was a style or a message or even whether it was for a
ListView or a Header control.  I just know I read about it in the Platform
SDK.  Even so, since the VB6 version of the ListView doesn't call into the
Common Control Library, you can't take advantage of that feature under XP
anyway (you might be able to using the VB5 version of the ListView since it
does call into the Common Control Library).

The only way I know to get these arrows is to use an ImageList and add them
yourself.  If you get into some API, however, you can add the arrows to the
right of the ColumnHeader text rather than to the left of the text.

Mike



Mon, 06 Sep 2004 10:35:18 GMT  
 ListView Control Sorting Arrow?
Quote:
> I'm trying to avoid using an ImageList with icons.

But... the OS uses an ImageList..

Both of these samples make use of the system imagelist.

VB TreeView and ListView Explorer demo
http://www.mvps.org/btmtz/vbexplorer/

SystemImagelist: How to associate the system imagelist with the VB ListView
http://www.mvps.org/btmtz/listview/

Note that the samples are built using the VB5 version of these controls...
switching over to VB6 controls shouldn't (but might) cause problems.. as
written anyway.

--
Ken Halter
MS-MVP-VB
Please keep it in the groups..

Quote:
> Using VB6.0 and the ListView Control 6.0.

> I'm looking to add the "up and down arrows" on the column
> headers to show which column is sorted and whether it's
> sorted in ascending or decending.

> I'm trying to avoid using an ImageList with icons.

> I want to get that "standard" windows look.  Open explorer
> and change it to Detailed view and you'll see what I'm
> talking about.



Mon, 06 Sep 2004 10:45:20 GMT  
 ListView Control Sorting Arrow?
Couple of links:

"How to Add Images to a ListView Header"
http://www.mvps.org/vbnet/code/comctl/lvheaderimage.htm

LVHeaderSortIcons section at:
http://www.mvps.org/btmtz/listview/

--
Brad Martinez, http://www.mvps.org
Please direct questions/replies to the newsgroup

Quote:

>Using VB6.0 and the ListView Control 6.0.

>I'm looking to add the "up and down arrows" on the column
>headers to show which column is sorted and whether it's
>sorted in ascending or decending.

>I'm trying to avoid using an ImageList with icons.

>I want to get that "standard" windows look.  Open explorer
>and change it to Detailed view and you'll see what I'm
>talking about.



Mon, 06 Sep 2004 10:54:22 GMT  
 ListView Control Sorting Arrow?

Ken

Quote:
>> I'm trying to avoid using an ImageList with icons.
>But... the OS uses an ImageList..

Missed this part: The header common control will only show
images from an imagelist common control (aka VB ImageList),
whose handle is specified by the IE3 HDM_SETIMAGELIST
message, unless owner-drawn of course...

Quote:
>Both of these samples make use of the system imagelist.

>VB TreeView and ListView Explorer demo
>http://www.mvps.org/btmtz/vbexplorer/

>SystemImagelist: How to associate the system imagelist with the VB ListView
>http://www.mvps.org/btmtz/listview/

>Note that the samples are built using the VB5 version of these controls...
>switching over to VB6 controls shouldn't (but might) cause problems.. as
>written anyway.

This is not an issue for the cLVHeaderSortIcons class (which
both above demos use, and is available at the LVHeaderSortIcons
link in my previous post in this thread). The class creates its own
real imagelist (as opposed to using VB's ImageList control).

--
Brad Martinez, http://www.mvps.org
Please direct questions/replies to the newsgroup



Mon, 06 Sep 2004 11:11:34 GMT  
 ListView Control Sorting Arrow?
I'll tuck this away for future reference... BTW.. that Explorer demo is
pretty darn cool <g>

--
Ken Halter
MS-MVP-VB
Please keep it in the groups..


Quote:

> Ken

> >> I'm trying to avoid using an ImageList with icons.
> >But... the OS uses an ImageList..

> Missed this part: The header common control will only show
> images from an imagelist common control (aka VB ImageList),
> whose handle is specified by the IE3 HDM_SETIMAGELIST
> message, unless owner-drawn of course...

> >Both of these samples make use of the system imagelist.

> >VB TreeView and ListView Explorer demo
> >http://www.mvps.org/btmtz/vbexplorer/

> >SystemImagelist: How to associate the system imagelist with the VB
ListView
> >http://www.mvps.org/btmtz/listview/

> >Note that the samples are built using the VB5 version of these
controls...
> >switching over to VB6 controls shouldn't (but might) cause problems.. as
> >written anyway.

> This is not an issue for the cLVHeaderSortIcons class (which
> both above demos use, and is available at the LVHeaderSortIcons
> link in my previous post in this thread). The class creates its own
> real imagelist (as opposed to using VB's ImageList control).

> --
> Brad Martinez, http://www.mvps.org
> Please direct questions/replies to the newsgroup



Mon, 06 Sep 2004 23:16:40 GMT  
 ListView Control Sorting Arrow?
I greatly appreciate all the help.  I finally got it
working and have to look I wanted.

Thanks again!

Quote:
>-----Original Message-----
>Using VB6.0 and the ListView Control 6.0.

>I'm looking to add the "up and down arrows" on the column
>headers to show which column is sorted and whether it's
>sorted in ascending or decending.

>I'm trying to avoid using an ImageList with icons.

>I want to get that "standard" windows look.  Open
explorer
>and change it to Detailed view and you'll see what I'm
>talking about.
>.



Tue, 07 Sep 2004 02:46:36 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Putting sort-direction arrows on listview columnheaders.

2. ListView Sort Arrows

3. Sort Order arrows in ListView ColumnHeaders?

4. Showing/Using Sort arrows on vb6 listviews?

5. up arrow, down arrow, left arrow, right arrow

6. capturing arrow keys in listview control

7. Listview Control with arrows

8. Get items from Listview sorted with API:s in sorted order

9. Adding Sorting Arrows to a ListBox ??

10. Adding Sorting Arrows to a ListBox ??

11. Sort arrows in outlook?

12. Sort arrows on column headers for VB6

 

 
Powered by phpBB® Forum Software