如何使应用程序响应Windows而不是用户在漫长的过程中? [英] How to make app responsive to windows but not to user during long process?

查看:54
本文介绍了如何使应用程序响应Windows而不是用户在漫长的过程中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想让我的应用程序重新绘制并在长期运行过程中显示等待光标,但实际上并未响应用户事件。什么是

实现这个的最好方法?


如果我只是将流程放在另一个线程上,用户可以继续

与表单互动。对于我自己的代码,我可以在所有

事件处理程序中有一个标志,但是控件内的交互怎么办(例如,在树视图中展开/折叠树节点)。如果我更改Enabled

属性,则会影响控件的视觉外观,我不想这样做。


有什么建议/例子吗?


谢谢,


Sam


I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What''s the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don''t want to do.

Any suggestions/examples?

Thanks,

Sam

推荐答案

Samual,


在早期关于你这样的问题的情况下,我曾经给出了

想法来设置一个小组(在表单上保存所有控件)并且设置为

要启用的面板是错误的。


这可能是你正在寻找的东西。关闭并最小化

框仍然有效,因此用户可以最小化调整大小并移动

表格。


我希望这有帮助


Cor


" Samuel R. Neff" < bl **** @ newsgroup.nospam>

..
Samual,

In an earlier situation about such a question as yours I once have given the
idea to set a panel (that holds all controls) on a form and too set that
panel to enable is false.

Is that maybe somehing you are looking for as well. The close and minimize
box is than still working so the user can minimize resize and move that
form.

I hope this helps

Cor

"Samuel R. Neff" <bl****@newsgroup.nospam>
..

我想让我的应用程序重绘并在长时间内显示等待光标<运行过程但实际上没有响应用户事件。实现这个目的的最佳方法是什么?

如果我只是将流程放在另一个线程上,用户可以继续与表单进行交互。对于我自己的代码,我可以在所有
事件处理程序中都有一个标志,但是控件内的交互如何(例如,在树视图中展开/折叠树节点)。如果我更改了Enabled
属性,则会影响控件的视觉外观,我不想这样做。

任何建议/示例?

谢谢,

Sam

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What''s the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don''t want to do.

Any suggestions/examples?

Thanks,

Sam





谢谢,但是仍然影响控件的视觉显示和

i想要避免(等待光标表示他们不能点击,

不需要禁用外观同样)。


Sam

周五,2005年1月7日17:01:24 +0100,Cor Ligthert

< no ************ @ planet.nl>写道:

Thanks, but that still affects the visual display of the controls and
i want to avoid that (the wait cursor indicates that they can''t click,
don''t need disabled appearance as well).

Sam
On Fri, 7 Jan 2005 17:01:24 +0100, "Cor Ligthert"
<no************@planet.nl> wrote:
Samual,

在早期关于你这样的问题的情况我曾经给出了设置一个小组的想法(那个在表单上保存所有控件)并且设置为启用的面板是错误的。

这可能是你正在寻找的东西。关闭并最小化
框仍然比仍然有效,因此用户可以最小化调整大小并移动该形式。

我希望这有助于

Cor

Samuel R. Neff < bl **** @ newsgroup.nospam>
Samual,

In an earlier situation about such a question as yours I once have given the
idea to set a panel (that holds all controls) on a form and too set that
panel to enable is false.

Is that maybe somehing you are looking for as well. The close and minimize
box is than still working so the user can minimize resize and move that
form.

I hope this helps

Cor

"Samuel R. Neff" <bl****@newsgroup.nospam>
.

我想让我的应用程序重新绘制并在漫长的
运行过程中显示等待光标但实际上并没有响应用户事件。实现这个目的的最佳方法是什么?

如果我只是将流程放在另一个线程上,用户可以继续与表单进行交互。对于我自己的代码,我可以在所有
事件处理程序中都有一个标志,但是控件内的交互如何(例如,在树视图中展开/折叠树节点)。如果我更改了Enabled
属性,则会影响控件的视觉外观,我不想这样做。

任何建议/示例?

谢谢,

Sam

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What''s the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don''t want to do.

Any suggestions/examples?

Thanks,

Sam






Samuel,


在这种情况下,它们仍然在那里,但有点阴影,我认为

等待光标这是特别好的。


但是只是我的想法。


Cor
Samuel,

In that case they are still there, however a little bit shadowed, I think
this is extra good with a wait cursor.

However just my idea.

Cor


这篇关于如何使应用程序响应Windows而不是用户在漫长的过程中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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