当用鼠标单击或以编程方式设置焦点时,列表框不会显示键盘插入符号
Listbox won't show keyboard caret when clicked on by mouse or focus programatically set
我正在使用带有 Extended
选择的 CListBox
。当我单击控件时,没有显示键盘插入符号。使用向上和向下箭头也不允许我显示插入符号。如果我按 tab 然后再按 shift tab,我就可以看到插入符号。使用 GotoDlgCtrl(&listboxCtrl)
或 listboxCtrl.SetFocus()
也不起作用。
如何让键盘插入符号在单击鼠标时或以编程方式显示?
使用鼠标不应该显示与键盘相关的 UI 功能:
For example, if the last input came from the mouse, the system will hide the keyboard cues. And, if the last input came from the keyboard, the system will show the keyboard cues.
要伪造更改,您可以使用:
PostMessage/SendMessage(hListBox, WM_UPDATEUISTATE, MAKELONG(UIS_CLEAR, UISF_HIDEACCEL|UISF_HIDEFOCUS), 0);
...或者如果您想将更改应用到所有 children.
,请将其发送到您的 top-level window
我正在使用带有 Extended
选择的 CListBox
。当我单击控件时,没有显示键盘插入符号。使用向上和向下箭头也不允许我显示插入符号。如果我按 tab 然后再按 shift tab,我就可以看到插入符号。使用 GotoDlgCtrl(&listboxCtrl)
或 listboxCtrl.SetFocus()
也不起作用。
如何让键盘插入符号在单击鼠标时或以编程方式显示?
使用鼠标不应该显示与键盘相关的 UI 功能:
For example, if the last input came from the mouse, the system will hide the keyboard cues. And, if the last input came from the keyboard, the system will show the keyboard cues.
要伪造更改,您可以使用:
PostMessage/SendMessage(hListBox, WM_UPDATEUISTATE, MAKELONG(UIS_CLEAR, UISF_HIDEACCEL|UISF_HIDEFOCUS), 0);
...或者如果您想将更改应用到所有 children.
,请将其发送到您的 top-level window