基本信息
源码名称:winform开机祝福,不规则窗体制作实例,有截图附源码
源码大小:0.04M
文件格式:.zip
开发语言:C#
更新时间:2013-04-23
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

此实例用的不是背景图片,是程序自绘的图 展示出很个性的窗体


 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Drawing.Drawing2D;

namespace BootStrapBeatitude
{
    public partial class Frm_Main : Form
    {
        public Frm_Main()
        {
            InitializeComponent();
        }

        private void Frm_Main_Load(object sender, EventArgs e)
        {
            GraphicsPath gp = new GraphicsPath(); 	//初始化一个表示一系列相互连接的直线和曲线的类
            Rectangle rect = new Rectangle(new Point(0, 0), new Size(this.Width, this.Height)); 	//初始化一个矩形操作区域
            gp.AddEllipse(rect); 				//向当前指定的路径下添加一个椭圆
            this.Region = new Region(gp); 		//设置与此控件关联的窗口区域
            this.label3.Text = DateTime.Now.ToShortDateString();	//在label3控件中显示当前的日期
            this.label5.Text = DateTime.Now.ToShortTimeString(); 	//在label5中显示当前的时间
            GraphicsPath gpstirng = new GraphicsPath(); 			//初始化一个表示一系列相互连接的直线和曲线的类
            FontFamily family = new FontFamily("宋体");			//初始化一个字体样式类
            int fontStyle = (int)FontStyle.Italic; 		//设置字体的样式类型
            int emSize = 25; 					//初始化一个emSize变量
            Point origin = new Point(0, 0); 		//初始化一个有序实数对的实例
            StringFormat format = StringFormat.GenericDefault; 	//实例化一个包含文本布局信息的对象
            gpstirng.AddString("开开心心每一天", family, fontStyle, emSize, origin, format); 	//向指定的路径添加字符串
            this.button1.Region = new Region(gpstirng); 			//设置与button1控件关联的窗口区域
            Registry.LocalMachine.CreateSubKey(@"SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN").SetValue("MyAngel", Application.StartupPath   "\\Ex05_13.exe", RegistryValueKind.String); 		//打开注册表中的现有项并设置其中的键值类型
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}