是否可以在Windows窗体上使用叠加进度条 [英] Is it possible for an Overlay Progress bar on Windows Forms
本文介绍了是否可以在Windows窗体上使用叠加进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Experts,
如果有可能在Windows窗体中使用VB.net覆盖进度条,有人可以告诉我
我有一个仪表板应用程序,其中一个表单需要时间来加载数据,因此我想显示Overlay Progress栏,以便用户不会点击任何内容,并且他也会知道某些内容正在加载。
非常感谢您的帮助。
Hello Experts,
Could someone let me know if it is possible for an Overlay Progress bar in windows Forms using VB.net
I have dashboard application where one form is taking time to load the data so I wanted to show Overlay Progress bar so that user doesn't click any and also he will know that something is loading up.
Your help is much appreciated.
推荐答案
create splash < br $>
private void timer1_Tick(object sender,EventArgs e)
{
counter ++;
progressBar1.Value = counter * 5;
// label2.Text =(5 * counter).ToString();
if(counter == 20)
{
timer1.Stop();
this.Close();
}
}
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,13F);
this.AutoScaleMode = System.Windows.Forms.AutoScale Mode.Font;
this.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
this.ClientSize = new System.Drawing.Size(397,283);
this.ControlBox = false;
this.Controls.Add(this.label2);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.label1);
this.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name =Splash;
this.ShowIcon = false;
this .ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.ResumeLayout(false);
this.PerformLayout();
然后在你的应用程序中
sp = new Splash();
sp .ShowDialog();
参考 ^ h ttp://stackoverflow.com/questions/7955663/how-to-build-splash-screen-in-windows-forms-application [ ^ ]
create splash
private void timer1_Tick(object sender, EventArgs e)
{
counter++;
progressBar1.Value = counter *5;
// label2.Text = (5*counter).ToString();
if (counter ==20)
{
timer1.Stop();
this.Close();
}
}
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
this.ClientSize = new System.Drawing.Size(397, 283);
this.ControlBox = false;
this.Controls.Add(this.label2);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.label1);
this.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Splash";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.ResumeLayout(false);
this.PerformLayout();
Then in your application
sp = new Splash();
sp.ShowDialog();
refer http://stackoverflow.com/questions/7955663/how-to-build-splash-screen-in-windows-forms-application[^]
这篇关于是否可以在Windows窗体上使用叠加进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文