| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 983 人关注过本帖
标题:版主帮我[求助]进度条的困难
只看楼主 加入收藏
xlmyuan
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2006-4-4
收藏
 问题点数:0 回复次数:4 
版主帮我[求助]进度条的困难

有一个报表在显示前要执行一个 存储过程,而且要几分钟才能执行完,
我想在执行的过程中使用 ProgressBar 缓解用户焦急的心情,
但不知如何设置 ProgressBar 的 Maximum 及其相关属性。
兄弟姐妹帮我一下。

[此贴子已经被作者于2006-4-6 10:26:25编辑过]

搜索更多相关主题的帖子: 进度 版主 困难 
2006-04-06 09:26
xlmyuan
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2006-4-4
收藏
得分:0 

求助呀,各位兄妹。

2006-04-06 10:18
唐伯猫
Rank: 8Rank: 8
等 级:贵宾
威 望:45
帖 子:5323
专家分:58
注 册:2005-8-9
收藏
得分:0 
根据需要直接调Minimum,Maximum,Value,Step属性就可以了。

<iframe name="alimamaifrm" frameborder="0" marginheight="0" marginwidth="0" border="0" scrolling="no" width="300" height="170" src="/go/app/tbk_app/chongzhi_300_170.php?pid=mm_28854300_2441872_11377541&page=chongzhi_300_170.php&size_w=300&size_h=170&stru_phone=1&stru_game=1&stru_travel=1" ></iframe>
2006-04-06 12:38
天气预报不准
Rank: 1
等 级:新手上路
帖 子:200
专家分:0
注 册:2006-3-16
收藏
得分:0 

应该可以直接在控件的属性视图里面设置,我刚刚做了个进度条的控件。


哎!发型有点乱。。。。。。
2006-04-06 16:44
天气预报不准
Rank: 1
等 级:新手上路
帖 子:200
专家分:0
注 册:2006-3-16
收藏
得分:0 

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace progBarApp
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Timers.Timer timer1;
private System.Windows.Forms.ProgressBar progressBar1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.timer1 = new System.Timers.Timer();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
this.SuspendLayout();
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.SynchronizingObject = this;
this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed);
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(40, 88);
this.progressBar1.Maximum = 200;
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(200, 20);
this.progressBar1.Step = 20;
this.progressBar1.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(280, 189);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.progressBar1});
this.Name = "Form1";
this.Text = "使用进度条";
((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit();
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (progressBar1.Value >= 200 )
{
progressBar1.Value = 0;
return;
}
progressBar1.Value += 20;
}
}
}


哎!发型有点乱。。。。。。
2006-04-06 16:48
快速回复:版主帮我[求助]进度条的困难
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016840 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved