I recently managed to make a ListView sort correctly by clicking on it's columns, it does sort items very well but there's a very annoying thing
: every time after the items are sorted out, an item gets focused ! After I click a column, one item gets blue'd, like when its selected, even if its not !
Note that this happens only becuase of this function : _GUICtrlListView_SimpleSort
Instead, the _GUICtrlListView_SortItems function is not doing this , but because of my luck,I must use _GUICtrlListView_SimpleSort
( but it is faster
)
Here's my script to test to see what I mean:
How could I get rid of this item focus ?
![>_<](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/pinch.gif)
Note that this happens only becuase of this function : _GUICtrlListView_SimpleSort
Instead, the _GUICtrlListView_SortItems function is not doing this , but because of my luck,I must use _GUICtrlListView_SimpleSort
![:(](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/sad.png)
![:)](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/smile.png)
Here's my script to test to see what I mean:
[ autoit ]
#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> $Form1 = GUICreate("Form1", 383, 307, 192, 124) $ListView1 = GUICtrlCreateListView("C1|C2|C3", 56, 16, 257, 241) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 50) $ListView1_0 = GUICtrlCreateListViewItem("1|5|6", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("2|7|8", $ListView1) $ListView1_2 = GUICtrlCreateListViewItem("3|9|10", $ListView1) $ListView1_3 = GUICtrlCreateListViewItem("4|11|12", $ListView1) GUISetState(@SW_SHOW) Global $toggle = 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ListView1 _GUICtrlListView_SimpleSort($ListView1, $toggle, GUICtrlGetState($ListView1)) EndSwitch WEnd
How could I get rid of this item focus ?