how to know the ASCII value of any key programmatically

First of all you have to add a Textbox in a form .Then you have to goto in the property of a textbox and  click on the Events of a textbox in a solution Explorer.(the sign of an Events is like a storm sign dark yellow in colour)


In a Events you have to double click on the KeyPress.
Once a keyPress method is loaded into the form1.cs ,you to write these code inside it.



private void textBox1_KeyPress_1(object sender, KeyPressEventArgs e) { MessageBox.Show(Convert.ToString(Convert.ToInt32(e.KeyChar))); }



Run the program you get the ASCII value of any character.............
I Hope you like this simple but interesting code.......