public Form1()
{
InitializeComponent();
this.Size = new System.Drawing.Size(300,300);
this.Text = "Form1";
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
}
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(48, 48);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.ResumeLayout(false);
}
protected override void WndProc(ref Message m)
{
if (m.Msg != WM_KEYDOWN)
{
base.WndProc(ref m);
}
else
{MessageBox.Show("1");
iChar = m.WParam.ToInt32();
switch(iChar)
{
case (int)Keys.D0:
this.button1.Text="1";
break;
case (int)Keys.D1:
MessageBox.Show("1");
break;
case (int)Keys.D2:
MessageBox.Show("2");
break;
default:
//Make sure that you pass unhandled messages back to the default message handler.
base.WndProc(ref m);
break;