using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms;namespace WindowsFormsApplication1 { class BoxText : Control { protected override void OnKeyPress(KeyPressEventArgs e) { e.Handled = true; Console.WriteLine(e.KeyChar.ToString()); base.OnKeyPress(e); } } }
现在知道,用户按下键盘后,直接被窗体获取事件
而不被输入法获取
怎么发送按键给输入法?
TextBox.ImeMode
完全自己的类……
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
class BoxText : Control
{
protected override void OnKeyPress(KeyPressEventArgs e)
{
e.Handled = true;
Console.WriteLine(e.KeyChar.ToString());
base.OnKeyPress(e);
}
}
}
为什么要全都自己写呢?
你要写的话,你画出来的框 里面的字也要自己画,用户输入不是中文,就不要画呗。
无焦点时,销毁光标过程就是这样,我试过。注:光标就是闪动的那根竖线
但是没有中文输入功能……
基类都自己写了
完全是自己的代码
我自己做了很多控件,基本上都实现了
就差这些需要调用系统的东西的控件……
本内容使用CSDN 小秘书回复
看帖回帖,发帖也要结贴哦!
*************************************************[/align]