开发者

when i press (*) how to get (.) in TextBox (in C# WinCE)

when i press (*) how to get (.) in TextBox (in C# WinCE)

i have TextBox and when i press the (*) letter i want to get the (.) letter

thank's i开发者_开发技巧n advance


Use the keypress and if the key is a '*' then replace it with '.'?

see here

private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
  if (e.KeyCode == Keys.Multiply) e.KeyCode = Keys.OemPeriod;
}

if you can't set the e.KeyCode then you can do:

private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
    {
      if (e.KeyCode == Keys.Multiply) 
      {
        e.Handled = true;
        tb.Text += "."
      }
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜