如何将焦点设置回窗口 [英] how to set focus back to a window
本文介绍了如何将焦点设置回窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我有一个图形窗口和一个列表控件.当我单击列表中的项目时,图形窗口将失去焦点.
如何从列表控件释放焦点并将焦点重新设置到图形窗口?
In my application, I have one graphic window and a list control. When I click on an item in the list, the graphic window loses focus.
How can I release focus from list control and set the focus back to graphics window??
推荐答案
使用窗口control.SetFocus();
可以将焦点重新设置到窗口上.
Use window control.SetFocus( );
That should set the focus back to the window.
您可以在处理列表项click事件的处理程序中进行操作.只需拨打parent->Focus()
或类似的电话即可.
You could do it in the handler where you handle the list item click event. Just call parent->Focus()
or something like that.
感谢你们的答复..它的工作原理..:)
thank u guys for ur answers.. its workin.. :)
这篇关于如何将焦点设置回窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文