Windows应用程序中的进度条 [英] Progress bar in windows application

查看:106
本文介绍了Windows应用程序中的进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好专家



我在vb.net中开发了Windows应用程序。

我在FTP上传文件所以需要一段时间上传。

此时,我想让表单看起来正在做某事,我不希望用户点击表单中的任何内容。这不仅仅是进度条。它与进度条相关,不允许用户单击表单控件。如何做到这一点?

Hello Experts

I have windows application developed in vb.net.
I am uploading a file in FTP and so it take a while to Upload.
At this time, I want to make the form look that it is doing something, and I don't want user to click on anything in the form. It is not just progress bar. It is something related to progress bar where user should not be allowed to click on the form controls. How can this be done?

推荐答案

确定所以你要做的是首先要定义一个变量,说明表单上的控件是否启用了this(它是一个布尔变量):

ok so what you want to do is first you want to define a variable stating weither or not the controls on the form are enabled like this(its a Boolean variable):
Dim FormEnabled As Boolean



那么当您想要启用或禁用表单控件时,您只需通过Me的Controls属性:


then when you want to enable or disable the form controls you just illiterate through the Controls property of Me:

If FormEnabled = False Then
    For Each Item As Control In Me.Controls
        Item.Enabled = FormEnabled
    Next
Else
    For Each Item As Control In Me.Controls
        Item.Enabled = FormEnabled
     Next
End If



然后在运行此if语句之前将Boolean设置为true或false,如下所示:


and then before you run this if statement you set the Boolean to either true or false like this:

FormEnabled = True
''Or
FormEnabled = False



如果您愿意如果你给我你的代码,我可以用你的代码中集成的控制禁用方法改进这篇文章。

Waraning:这将禁用应用程序中的所有控件,直到你重新启用它们为止。 />
告诉我这是否有帮助,

MasterCodeon


if you would like i can improve this post with this control disabling method integrated into your code if you give me your code.
Waraning: this will disable all of the controls in the application until you reenable them.
tell me if this helps,
MasterCodeon


这篇关于Windows应用程序中的进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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