如何保持对话的焦点而又不失去形式的焦点? [英] How to maintain the focus of the dialogue, without losing the focus of the form?

查看:88
本文介绍了如何保持对话的焦点而又不失去形式的焦点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要编辑记事本文件的应用程序.我完成了记事本的标准菜单,然后单击其中的某些菜单(查找",查找下一个",替换",转到"),它们将调用显示文本框和按钮以执行所选任务的对话框,例如记事本.
当我单击查找"菜单时,将调用查找"对话框,它具有与记事本"对话框相同的按钮.因此,当我键入一些文本并单击查找下一个"按钮时,将调用一个定位该文本的例程,并在包含我正在使用的记事本文本的文本框中选择找到的文本.我希望在选择了文本之后,对话框仍然显示,并且当我再次单击查找下一个"按钮时,要在没有对话框的情况下选择的下一个文本会失去焦点,因此我可以单击包含以下内容的文本框:记事本.就像Windows记事本一样.
我知道调用对话框的两种方法,方法show()和ShowDialog(),但我什么也做不了.
有人知道我该怎么做吗,谢谢您.

I am developing an application where I need to edit a Notepad file. I did the standard menus of the Notepad, and when some of them are clicked (Find, Find Next, Replace, Go To) they call dialogs that display textboxes and buttons to perform the selected task, such as Notepad.
When I click the Find menu, the Find dialog is called, it has the same buttons that the dialog Find of the Notepad. So when I type some text and click the Find Next button a routine that locates the text will be called, and found text will be selected in the text box containing the text of the Notepad in which I am using. I want that after the text was selected the dialog remains displayed, and when I click the Find Next button again, the next text to be selected without the dialog loses focus, and I can click on the text box, which contains the text of the Notepad. Just like the Windows Notepad.
I know two ways to call the dialog, the methods show () and ShowDialog (), but with none of them I can do what I want.
Does anyone know how I can do this, thank you in advance.

推荐答案

我不确定您的意思,但是TopMost属性是否可以您的查找对话框需要什么?即使失去焦点,它也将使对话框保持在顶部.
I''m not sure exactly what you mean, but would the TopMost property for your find dialog do what you need? It will keep the dialog form on top, even if it loses focus.


这篇关于如何保持对话的焦点而又不失去形式的焦点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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