Not a very clever response that really, is it?!
Obviously I want the functionality of the AcceptButton!
I have figured it out now anyway:
I implemented an AcceptsReturn property in a subclassed ListView.
I then overrode the ProcessDialogKey:
protected override bool ProcessDialogKey(System.Windows.Forms.Keys keyData)
{
if(keyData == Keys.Enter && this.AcceptsReturn)
keyData = 0;
return base.ProcessDialogKey(keyData);
}
I can then pick up the Return Button from a listView using the old KeyDown event!
Fantastic eh?
mat
> So don't set the AcceptButton property then!
> Or turn it off when the ListView gets focus
[quoted text clipped - 21 lines]
> >
> > mat
Claes Bergefall - 23 Jul 2004 08:12 GMT
> Not a very clever response that really, is it?!
Actually, the second part should work (turn it of when the
listview gets focus and turn it back on when it looses it)
/claes
mat holton - 23 Jul 2004 10:09 GMT
>Actually, the second part should work (turn it of when the
>listview gets focus and turn it back on when it looses it)
Yeah, you are right, sorry about my flippent reply. Unfortunatly your
proposed method would have to be implemented for all uses of a listview,
whilst my method only need to be done once!
Thanks for the help anyway!
mat