You'll have to add your own code for that. It's pretty easy with some
inheritance and P/Invoke stuff. Something like this should work (inherit
ListView):
private const int WM_NOTIFY = 0x4E;
private const int NM_FIRST = 0;
private const int NM_RCLICK = NM_FIRST - 5;
[StructLayout(LayoutKind.Sequential)]
private struct NMHDR
{
public IntPtr hwndFrom;
public int idFrom;
public int code;
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == WM_NOTIFY)
{
NMHDR nm = (NMHDR) m.GetLParam(typeof(NMHDR));
if (nm.code == NM_RCLICK)
{
// TODO: Handle right click
}
}
base.WndProc(ref m);
}
/claes
"Robert W." <Ro*****@discussions.microsoft.com> wrote in message
news:87**********************************@microsof t.com...
I learned how to sort a ListView by clicking on the column headers from
this:
http://msdn2.microsoft.com/en-us/lib...temsorter.aspx
I'm wondering if there's a way to reverse sort it with a right-click? I
tried monitoring the MouseDown event but it didn't fire when the header
was
right-clicked.
Any ideas?
--
Robert W.
Vancouver, BC
www.mwtech.com