如何制作winform得启动画面

王朝system·作者佚名  2008-05-30
窄屏简体版  字體: |||超大  

using System;

using System.Collections.Generic;

using System.Text;

using System.Windows.Forms;

using System.Drawing;

namespace SlashScreenLib

{

public class SlashScreenForm:Form

{

static SlashScreenForm slashScreen;

Bitmap bitMap;

public static SlashScreenForm SlashScreen

{

get

{

if (slashScreen == null)

{

slashScreen = new SlashScreenForm();

}

return slashScreen;

}

}

public SlashScreenForm()

{

//SlashScreen肯定显示在屏幕中央

this.StartPosition = FormStartPosition.CenterScreen;

//应该没有边框

this.FormBorderStyle = FormBorderStyle.None;

//获取SlashScreen要显示的图片

bitMap = Resources.Resource.SlashScreen;

//窗口大小与图片大小一致

this.ClientSize = bitMap.Size;

//在图片上写上字

using (Font f = new Font("宋体", 18))

{

using (Graphics g = Graphics.FromImage(bitMap))

{

g.DrawString("Jillzhang", f, Brushes.Black, 100, 142);

}

}

this.BackgroundImage = bitMap;

}

protected override void Dispose(bool disposing)

{

base.Dispose(disposing);

if (disposing)

{

if (bitMap != null)

{

bitMap.Dispose();

bitMap = null;

}

}

}

}

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航