如何为 VB.net 程序创建启动画面
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6406522/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create a Splash screen for VB.net program
提问by Kuzon
How do i create a Splash Screen for a vb.net program? I want to make a visual that will come up before the programs starts and after it finishes in this possible?
如何为 vb.net 程序创建启动画面?我想制作一个在程序启动之前和完成之后出现的视觉效果,这可能吗?
采纳答案by msarchet
http://msdn.microsoft.com/en-us/library/bfkbc5a3(v=VS.100).aspx
http://msdn.microsoft.com/en-us/library/bfkbc5a3(v=VS.100).aspx
Basically you set the form that you want to use as a splash screen in the program properties in Visual Studio. Very simple.
基本上,您可以在 Visual Studio 的程序属性中设置要用作启动画面的表单。很简单。
回答by audie
- Open Your vb.net
- Add new project
- Go to properties of your form
- Clear the Text
- Set the FormBorderStyleto None.
- Insert a background image.
- Set the background image to stretch.
- Add a ProgressBar, a Timerand a Labelto your form.
- Go to properties of timer set the Intervalinto 50and Enabledto true.
- Double click the Timer event.
Populate This Code Inside The Private Sub Timer_Tick;
ProgressBar1.Increment(1) If ProgressBar1.value = 100 Then Me.hide() form2.Show() End IF
- Incrementwhich mean to increase by 1.
- form2.showto show an another form if the ProgressBarwas done processing.
- In a Label you must rename it whatever you want.
- 打开你的 vb.net
- 添加新项目
- 转到表单的属性
- 清除文本
- 将FormBorderStyle设置为 None。
- 插入背景图像。
- 将背景图像设置为拉伸。
- 向表单添加ProgressBar、Timer和Label。
- 转到计时器的属性,将Interval设置为50并将Enabled 设置为true。
- 双击计时器事件。
在私有子 Timer_Tick 中填充此代码;
ProgressBar1.Increment(1) If ProgressBar1.value = 100 Then Me.hide() form2.Show() End IF
- Increment表示增加 1。
- 如果ProgressBar已完成处理,则form2.show显示另一个表单。
- 在标签中,您必须根据需要对其进行重命名。
回答by Guppy Platy
improvement of other solution disable Timer before show other form
其他解决方案的改进在显示其他形式之前禁用计时器
ProgressBar1.Increment(1)
If ProgressBar1.value = 100 Then
Me.hide()
Timer1.Enabled = False
form2.Show()
End IF