Saving Listview Selected Item Problems

Tech-Archive recommends: Fix windows errors by optimizing your registry



When I exit my app, I save the listview selected item index in a text file.
When I open the app, I retrieve this index and select the item again in the
listview. This is working sporatically. Sometimes when I click on a
different column in the listview to change the sorting, if I close my app
and re-open it, I have a different item in the listview selected.
Othertimes when I do this it works fine. I am also saving the sort key and
sort order. How can I make it so that no matter what column is sorted, the
same item in the listview is retrieved when the app is opened?

--

Thanks.



.



Relevant Pages

  • Re: Sending WM_LBUTTONDBLCLK to a ListView control
    ... I wrote up a quick WinForm app with a button and a listview. ... HWND of the listview and using its PointToScreen/PointToClient functions. ... public const UInt32 WM_MOUSEACTIVATE = 0x0021; ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Sending WM_LBUTTONDBLCLK to a ListView control
    ... I wrote up a quick WinForm app with a button and a listview. ... HWND of the listview and using its PointToScreen/PointToClient functions. ... public const UInt32 WM_MOUSEACTIVATE = 0x0021; ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Sending WM_LBUTTONDBLCLK to a ListView control
    ... clicking on the ListView). ... To simplify the troubleshooting I have built a simple .NET app with a label ... public const UInt32 WM_MOUSEACTIVATE = 0x0021; ... public static extern IntPtr SendNotifyMessage(IntPtr hWnd, uint Msg, IntPtr ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Sending WM_LBUTTONDBLCLK to a ListView control
    ... "app a" is definately a Listview. ... public const UInt32 WM_MOUSEACTIVATE = 0x0021; ... public static extern IntPtr SendNotifyMessage(IntPtr hWnd, uint Msg, ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Saving Listview Selected Item Problems
    ... When I open the app, I retrieve this index and select the item ... click on a different column in the listview to change the sorting, ... sort key and sort order. ...
    (microsoft.public.vb.general.discussion)