using System;
using System.Windows.Forms;public class Form1: Form
{
public Form1()
{
TextBox tb = new TextBox();
this.Controls.Add(tb);
tb.KeyPress += new KeyPressEventHandler(keypressed);
} void keypressed(Object o, KeyPressEventArgs e)
{
if(e.KeyChar == (char)13)
e.Handled=true;
} public static void Main()
{
Application.Run(new Form1());
}
}msdn的例子。
using System.Windows.Forms;public class Form1: Form
{
public Form1()
{
TextBox tb = new TextBox();
this.Controls.Add(tb);
tb.KeyPress += new KeyPressEventHandler(keypressed);
} void keypressed(Object o, KeyPressEventArgs e)
{
if(e.KeyChar == (char)13)
e.Handled=true;
} public static void Main()
{
Application.Run(new Form1());
}
}msdn的例子。
解决方案 »
- 正则求解.....
- DEV控件 GridControl 问题
- 关于URL路径加密的问题 大家看看12cc0a90-6263-4464-a5df-50d56aab3858.html 是怎么弄的啊
- C#:当HTML代码中含数学符号时的过滤问题
- 混淆器的设计文档和源代码谁想要啊
- 请问,我如何才能把SQL数据库中的数据保存成Access数据库的MDB文件
- 如何通过Microsoft OLE DB Provider For Oracle连接ORACLE9i?
- 初学socket的疑惑
- TabControl中如何把其中的一个TabPage给暗掉?
- 如何要求客户端,在CheckBoxList中必选其中一个,?
- Help!!!!!!!!!!!!!!
- 怎样判断文件是否存在和文件夹是否存在?有FileExists()这样的方法吗?
不过还没解决我说的问题,我的意思是光标再Textbox1时敲回车光标就到
Textbox2中了。
{
if (aKey == Keys.Enter)
{SendKeys.Send("{TAB}");
return true;}
base.ProcessDialogKey(aKey);
return false;
}
----------------------------------------
To teach a fish how to swim.
就方便多了。