如何在寡妇应用程序中将进度条显示为窗体中心的弹出窗口? [英] How to show progress bar as popup in center of form in widows application ?
问题描述
嗨
我正在开发windows应用程序,因为我需要弹出进度条,在按钮点击事件中我需要在Windows窗体应用程序的中心显示进度条,例如。当开始关闭进度条时代码之间执行2到5分钟,所以我需要向用户显示一条消息(如Please Wait ...)。在按钮形式已经得到控制,所以我不能在设计时将进度条放在窗体的中心。
私人 Sub BtnCheckin_Click( ByVal sender As System。 Object , ByVal e As System.EventArgs)< span class =code-keyword>句柄 BtnCheckin.Click
' 这里需要启动显示进度条
.................. .......
........................
........... ...........
........................
....... ..................
........................
......................
........................
' 这里需要关闭进度条
结束 Sub
注意:为什么代码执行2到5分钟,bcz我将绑定(超过10000)节点到树视图,因此在树视图中绑定节点需要2到5分钟。
请回复asap
问候
Aravind
< blockquote>请先阅读我的评论。
看看这里: http://www.experts-exchange.com/Programming/Languages/.NET/Q_23786595.html [ ^ ]
如果你不能要查看解决方案,请参阅:
// --BEGIN
// 在我的主要部分主要表单
pb.Style = ProgressBarStyle.Marquee;
pb.MarqueeAnimationSpeed = 30 ;
private BackgroundWorker worker = null ;
worker = new BackgroundWorker();
worker.DoWork + = new DoWorkEventHandler(worker_DoWork);
worker.RunWorkerAsync();
// --- END
void worker_DoWork( object sender,DoWorkEventArgs e)
{
BuildTree();
}
概念是使用BackgroudWorker。
http://www.c-sharpcorner.com/UploadFile/LivMic/BGWorker07032007000515AM/BGWorker.aspx [ ^ ]
如果您想在父表单的中心显示带有progressbarr的表单,请使用正确的 StartPosition [ ^ ]或位置。
如何:设置Windows窗体的屏幕位置 [ ^ ]
Hi
I am develop windows application,in that i need to popup progress bar,in button click event i need to show progress bar at center of windows forms application,for example.When start to close progress bar in between code execute 2 to 5 mins ,so that time i need to show one message(like "Please Wait...") to user.In button form already got control,so i cant put progress bar at center of form at design time.
Private Sub BtnCheckin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCheckin.Click
'Here need to start to show progress bar
.........................
........................
......................
........................
.........................
........................
......................
........................
'Here need to close progress bar
End Sub
Note: why code ececute 2 to 5 mins,bcz i will bind(more than 10000) node to treeview,so it take 2 to 5 mins to bind node in treeview.
Pls reply asap
Regards
Aravind
Please, read my comment first.
Have a look here: http://www.experts-exchange.com/Programming/Languages/.NET/Q_23786595.html[^]
In case you're not able to view the solution, please see:
//--BEGIN // In my main section of the 'main form' pb.Style = ProgressBarStyle.Marquee; pb.MarqueeAnimationSpeed = 30; private BackgroundWorker worker = null; worker = new BackgroundWorker(); worker.DoWork +=new DoWorkEventHandler(worker_DoWork); worker.RunWorkerAsync(); //---END void worker_DoWork(object sender, DoWorkEventArgs e) { BuildTree(); }
The concept is to use BackgroudWorker.
http://www.c-sharpcorner.com/UploadFile/LivMic/BGWorker07032007000515AM/BGWorker.aspx[^]
If you would like to show form with progressbarr on the center of parent form, use proper StartPosition[^] or Location.
How to: Set the Screen Location of Windows Forms[^]
这篇关于如何在寡妇应用程序中将进度条显示为窗体中心的弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!