各位大哥,小弟有个问题请教下 求好心人解答,谢谢!!
textbox只可以输入日文汉字,平假名,片假名,现在的代码只允许输入平假名,片假名不能输入日文汉字
private void cskanatxt_TextChanged(object sender, EventArgs e)
{
int len = text.Length;
if (len < csnametxt.Text.Length)
{
int index = csnametxt.Text.IndexOf(text);
string c = (csnametxt.Text.Remove(index, text.Length))[0].ToString();
if (!Regex.IsMatch(c, "[\u0800-\u4e00]"))
{
csnametxt.Text = text;
MessageBox.Show("箇所名称には20桁以内の文字で入力してください");
csnametxt.SelectionStart = text.Length;
}
}
text = csnametxt.Text;求解答谢谢了 在线等!!!!!!
textbox只可以输入日文汉字,平假名,片假名,现在的代码只允许输入平假名,片假名不能输入日文汉字
private void cskanatxt_TextChanged(object sender, EventArgs e)
{
int len = text.Length;
if (len < csnametxt.Text.Length)
{
int index = csnametxt.Text.IndexOf(text);
string c = (csnametxt.Text.Remove(index, text.Length))[0].ToString();
if (!Regex.IsMatch(c, "[\u0800-\u4e00]"))
{
csnametxt.Text = text;
MessageBox.Show("箇所名称には20桁以内の文字で入力してください");
csnametxt.SelectionStart = text.Length;
}
}
text = csnametxt.Text;求解答谢谢了 在线等!!!!!!
输入假名后点Space无法转换吗?还是转换后有提示信息?
有时系统IME输入法无法转换汉字,是因为系统精简后缺少字典文件引起的,从别的电脑上拷贝一份到你的电脑上就恢复正常了。或者可以下载第三方的Google日本语入力试一下。如果是转换成汉字后提示错误信息,就是程序的问题了。
(!Regex.IsMatch(c, "[\u0800-\u4e00]"))
我觉得就是这句代码的事
这句代码什么意思啊?
如果字符串c不是日文