We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Regd--- # Key

Thread ID:

Created:

Updated:

Platform:

Replies:

41976 Mar 16,2006 10:26 AM UTC Mar 17,2006 06:53 AM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 16, 2006 10:26 AM UTC

Hi There, I am using gridDataBoundGrid.There is a virtual method with the following signature "ProcessKeyMessage(ref Message m)".I have overrided it, in that method i am writing the following statement. Keys keyCode = (Keys)((int)m.WParam) & Keys.KeyCode; The KeyCode returns me "End" when we press "Shift + 3" key which is supposed to send me "#".Kindly solve the problem as early as possible. Thanks in advance, Thanks & Regards, Manohar B.

Administrator [Syncfusion]
Replied On March 16, 2006 12:20 PM UTC

Hi Manohar, Try the below code snippet to see if that helps. Keys keyCode = (Keys)((int)m.WParam) & Keys.KeyCode; if (m.Msg == 0x102/*WM_CHAR*/ || m.Msg == 0x106/*WM_SYSCHAR*/) Console.WriteLine(((Char)m.WParam).ToString()); Regards, Calvin.

Administrator [Syncfusion]
Replied On March 17, 2006 05:06 AM UTC

Hi Clavin, Happy to see the working code,but can you just give some explanation on the code that you have give.What i noticed is it is firing for all characters(also special) but not for stokes like "Home","End","Right Arrow" etc,.Can you just tell how does the latest code snippet give by you differs from the previous which i have given you. Thanks in advance, Thanks & Regards, Manohar B. >Hi Manohar, > >Try the below code snippet to see if that helps. > >Keys keyCode = (Keys)((int)m.WParam) & Keys.KeyCode; > > if (m.Msg == 0x102/*WM_CHAR*/ || m.Msg == 0x106/*WM_SYSCHAR*/) > Console.WriteLine(((Char)m.WParam).ToString()); > >Regards, >Calvin.

Administrator [Syncfusion]
Replied On March 17, 2006 06:53 AM UTC

Hi Manohar, The Keys specifies only the key codes and modifiers and not the key char. To get the key char the WParam must be cast to Char. Below is code snippet which checks for the Shift Modifier key and then get the char value else just the keyCode. Let us know if this serves your need. if(Control.ModifierKeys == Keys.Shift && m.Msg == 0x102/*WM_CHAR*/ ) Console.WriteLine(((Char)m.WParam).ToString()); else Console.WriteLine(((Keys)((int)m.WParam)).ToString()); Regards, Calvin.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;