ListViewEx and MySortOrder related changes.

This commit is contained in:
Milan Hanajik
2021-11-13 05:38:10 +01:00
parent 9b5ee442a6
commit 772080ae3b
13 changed files with 59 additions and 49 deletions
+6 -4
View File
@@ -55,7 +55,7 @@ namespace Common.Forms
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, ref HDITEM lParam);
public static void SetSortIcon(this ListViewEx listViewControl, int columnIndex, SortOrder order)
public static void SetSortIcon(this ListViewEx listViewControl, int columnIndex, MySortOrder order)
{
IntPtr columnHeader = SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
for (int columnNumber = 0; columnNumber <= listViewControl.Columns.Count - 1; columnNumber++)
@@ -71,16 +71,18 @@ namespace Common.Forms
throw new Win32Exception();
}
if (order != SortOrder.None && columnNumber == columnIndex)
if (order != MySortOrder.None && columnNumber == columnIndex)
{
switch (order)
{
case SortOrder.Ascending:
case MySortOrder.Ascending:
case MySortOrder.Ascending2:
item.fmt &= ~HDITEM.Format.SortDown;
item.fmt |= HDITEM.Format.SortUp;
break;
case SortOrder.Descending:
case MySortOrder.Descending:
case MySortOrder.Descending2:
item.fmt &= ~HDITEM.Format.SortUp;
item.fmt |= HDITEM.Format.SortDown;
break;