一,歡迎界面:
1.1,添加一個FrmSplashScreen窗體
屬性設置:
ShowInTaskBar-->False:不顯示任務欄圖標
StartPositon-->CenterScreen:程序置於屏幕中央
Size-->700,400:背景圖片的尺寸
FormBorderStyle-->None:取消窗體邊框,
1.2,添加一個PictureBox pic_Background
屬性設置:
Dock-->Fill
SizeMode-->StretchImage
Image-->選擇圖片
1.3 添加panel panel_ProgressBarContainer
屬性設置
Dock-->Bottom:放在最下面
再添加一個panel panel_ProgressBar
拖動到panel_ProgressBarContainer的左邊,拉到合適的寬度

1.4 添加timer控件

timer事件的代碼,實現滾動條的效果
private void timer_ProgressBar_Tick(object sender, EventArgs e)
{
panel_ProgressBar.Width += 5;
if (panel_ProgressBar.Width >= panel_ProgressBarContainer.Width)
{
timer_ProgressBar.Stop();
this.DialogResult = DialogResult.OK;
}
}
1.5 在應用程序的主入口添加下面的代碼 Program.cs

1.6 最終效果

另外:Label的透明設置方法,見我的另外的一個博客
