Monday, June 29, 2020

KeyCode vs. KeyData vs. KeyValue

When trying to examine user keystrokes in Windows Forms, the .Net Framework and .Net Core offer a variety of properties:

 

Keys: an enumeration in the System.Windows.Forms namespace that Specifies key codes and modifiers.

 

KeyCode: returns the System.Windows.Forms.Keys value that is the key code for the event.

 

KeyData: Returns the System.Windows.Forms.Keys representing the key code for the key that was pressed, combined with modifier flags that indicate which combination of CTRL, SHIFT, and ALT keys was pressed at the same time.

 

KeyValue: returns the integer representation of the KeyCode property.

 

 

Example:

tbUnitPrice.PreviewKeyDown += new PreviewKeyDownEventHandler(this.tbUnitPrice_PreviewKeyDown);  //Add event handler to capture keystroke

 

 

        private void tbUnitPrice_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)

        {

            var keycode = e.KeyCode;

            var keydata = e.KeyData;

            var keyValue = e.KeyValue;

 

            if ( (keycode == Keys.Tab) || (keycode == Keys.Enter) )

            {

                dgParts.CurrentCell = dgParts.Rows[dgParts.CurrentRow.Index + 1].Cells[0];                   //Move to the 1st cell of the next row

 

            }

        }

 

Thursday, June 25, 2020

Wednesday, June 17, 2020

BlazorDay is June 18, 2020

BlazorDay is almost here. Starting Thursday, June 18, at 8:00 AM Pacific Time or 5:00 PM Paris Time.
Don't miss the keynote with Daniel Roth, the Blazor Program Manager at Microsoft. Daniel will be followed by 8 greats experts of the Blazor world.

1. What is the session planning?
The full planning is available on https://www.blazorday.net/planning.

2. How to see the live show?
Go to https://BlazorDay.net/live or directly to Youtube on https://youtu.be/XoizucRjxgU.
The same stream is also available on Facebook and on Twitch.

3. How to submit your questions?
Use the Youtube chat (or Facebook or Twitch chats) to submit your questions to the speakers. We will relay these questions at the end of the presentation.

4. How to replay the show?
After the live, the video will be available on https://devapps.ms or https://BlazorDay.net/live.