Herfried,
The rest of the thread you pointed me to did include a VB.Net solution from
Jay Harlow.
I just implemented it and it works great.
The trick is to change the column text value when sorting by adding 3 spaces
and the Unicode characters for the small black Up and Down triangles. Strip
them off when changing columns.
Sample code for lurkers:
Protected Overrides Sub dvDisplay_ColumnClick(ByVal sender As Object, ByVal
e As System.Windows.Forms.ColumnClickEventArgs)
'remove sort icon from old column.
If SortColumn <> -1 Then
lv.Columns.Item(SortColumn).Text =
lv.Columns.Item(SortColumn).Text.TrimEnd(Chr(32), Chr(32), Chr(32),
ChrW(&H25B2), ChrW(&H25BC))
End If
If e.Column <> SortColumn Then
SortColumn = e.Column
mSortDirection = "ASC"
'add down icon
lv.Columns.Item(SortColumn).Text &= " " & ChrW(&H25B2)
Else
If mSortDirection = "ASC" Then
mSortDirection = "DESC"
'do the sort
'add down icon
lv.Columns.Item(SortColumn).Text &= " " & ChrW(&H25BC)
Else
mSortDirection = "ASC"
'do the sort
'add up icon
lv.Columns.Item(SortColumn).Text &= " " & ChrW(&H25B2)
End If
End If
End Sub
--
Joe Fallon
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Joe Fallon" <jf******@nospamtwcny.rr.com> scripsit: I don't speak C++.
I guess you are saying there is no VB.Net way to do this.
There is a VB.NET way, by using p/invoke. You will find a VB6 sample
here, sorry, I don't have a .NET implementation:
<http://www.mvps.org/vbnet/code/comctl/lvheaderimage.htm>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>