DataGridView(WinForms) - 单元格不会在重音字符上进入编辑模式 [英] DataGridView (WinForms) - cell not going into edit mode on accented characters

查看:56
本文介绍了DataGridView(WinForms) - 单元格不会在重音字符上进入编辑模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

Hello All,

我注意到,当按下第一个字符时,DataGridView不会进入编辑模式,在某些国家键盘上加上重音/特殊字符(例如波兰语)。问题是,在这些键盘上,右侧alt用作AltGr,它是ctrl + alt
的组合,与标准(左)alt具有不同的用途。在美国/国际键盘上 - 两个都发送相同的代码和系统消息(WM_SYSKEYDOWN),但是带有AltGr的键盘发送WM_KEYDOWN用于右侧alt,WM_SYSKEYDOWN用于左侧alt,加上一些
附加标志。

I noticed, that DataGridView is not going into edit mode when first character pressed is accented/special character on some national keyboards (eg. Polish). The thing is that on these keyboards right alt is used as AltGr, which is combination of ctrl+alt and has different use than standard (left) alt. On the US/international keyboard - both alts send the same code and system message (WM_SYSKEYDOWN), however the keyboards with AltGr send WM_KEYDOWN for right alt, and WM_SYSKEYDOWN for the left alt, plus some additional flags.

结果是:


  • 当选择DGV中的单元格时,我们按下任何"标准"字符 - 进入编辑模式,字符显示在单元格中(abc D 1 2 3 ....)

  • 按下重音/特殊字符时(例如。 ś,Ś,ż...) - 单元格不进入编辑模式,因此单元格中没有输入任何内容

可能的解决方法:


  1. 将DGV的editmode切换到Enter / F2 - 我不希望/不能
  2. 编写自己的onkeypress处理程序来处理特殊字符
  3. 继承DGV类并重写方法/函数,如processcmdkey,isinputchar,isinputkey等,并处理系统消息(WM _...)

问题:


  1. 有没有办法在.net中修复它(winforms,不知道它在WPF中是如何工作的)?
  2. 这是一个错误或自然行为,应该/可以报告为错误吗?

推荐答案

你好yaqq,

Hi yaqq,

就像你提到的标题一样,你的案例与Winfrom更相关,我会帮助您的案例从winfrom论坛获得更好的支持。

Like your title mentioned, your case more related to Winfrom, I will help move your case to winfrom forum for better support.

祝你好运,

Kristin


这篇关于DataGridView(WinForms) - 单元格不会在重音字符上进入编辑模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆