Re: ListView KeyPress event
From: Stuart Celarier (stuartNO_at_SPAMferncrk.com)
Date: 12/10/04
- Next message: Peter Foot [MVP]: "Re: Shellexecute a CAB File"
- Previous message: Chris Tacke, eMVP: "Re: cepview.exe for windows Mobile 2003"
- In reply to: Serg Kuryata [MS]: "RE: ListView KeyPress event"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Dec 2004 07:42:03 -0800
Sergiy wrote:
>The KeyPress event is supported for ListView in the .NET Compact
Framework V1 SP2.
Say, I looked into this. The ListView.KeyPress event is exposed in the
.NET Compact Framework, but maybe I am using it incorrectly. A complete
program is included below: I never get the MessageBox from
listView_KeyPress. This approach works on the .NET Framework. What am I
missing?
Cheers,
Stuart Celarier, Fern Creek
using System.Drawing;
using System.Windows.Forms;
namespace SmartDeviceApplication6
{
public class Form1 : Form
{
private ListView listView;
public Form1()
{
listView = new ListView();
listView.Location = new Point(10 , 10);
ListViewItem lvi = new ListViewItem( "Item" );
listView.Items.Add( lvi );
Controls.Add( listView );
Text = "Form1";
listView.KeyPress += new KeyPressEventHandler( listView_KeyPress
);
}
private void listView_KeyPress( object sender, KeyPressEventArgs e )
{
MessageBox.Show( "Key pressed" );
}
static void Main()
{
Application.Run( new Form1() );
}
}
}
- Next message: Peter Foot [MVP]: "Re: Shellexecute a CAB File"
- Previous message: Chris Tacke, eMVP: "Re: cepview.exe for windows Mobile 2003"
- In reply to: Serg Kuryata [MS]: "RE: ListView KeyPress event"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|