Re: ListView KeyPress event

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Stuart Celarier (stuartNO_at_SPAMferncrk.com)
Date: 12/10/04


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() );
    }
  }
}



Relevant Pages

  • Re: Custom ListView sorting
    ... In the documentation it's not marked as "Supported by the .NET Compact ... >I am trying to implement custom sorting in a listview. ... > Is this a property that is not supported in the Compact Framework version ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ListView KeyPress event
    ... worked just fine as long as the ListView control had focus. ... |>The KeyPress event is supported for ListView in the .NET Compact ... | .NET Compact Framework, but maybe I am using it incorrectly. ... | public class Form1: Form ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: VS 2005 - Problems deploying C# executable to target
    ... registry from the last version of the OS before adding the framework ... version of .NET compact framework" doesn't seemtohelp. ... deploying the application, but no combination seems to work. ... sysgen the entire system after this installation? ...
    (microsoft.public.windowsce.embedded)
  • Re: VS 2005 - Problems deploying C# executable to target
    ... the ActiveSync startup server and that the TCP ... The registry is persistent from one boot to ... registry from the last version of the OS before adding the framework ... version of .NET compact framework" doesn't seemtohelp. ...
    (microsoft.public.windowsce.embedded)
  • RE: how to compile code both for .net compact framework and .net f
    ... libraries, then declare a conditional compilation constant which can be ... This does limit you to using the limited CF framework class ... I have a c# source file which wants to be used for both .net compact ...
    (microsoft.public.dotnet.framework.compactframework)