网站导航免费论文 原创论文 论文搜索 作业答案 网学软件 学术大家 资料中心 会员中心 问题解答 定作论文 论文素材 设计下载 最新论文 下载排行 论文上传 在线投稿 联系我们
返回网学首页
最新论文 推荐专题 热门论文 素材专题
当前位置: 网学 > 交易代码 > ASP.Net精品代码 > 正文
c#一种简单快速改变窗体风格和肤色的方法源码及其控件
来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 佚名 来源: 网络 发布时间: 10/11/03

本人初学C#,水平很有限,请批评指正!
C#应用程序启动时:
Application.Run(new Form1());
新建了一个窗体,但是很难在窗体建立后随意改变窗体风格和颜色,本人初学,但经过一番试验发现了如下方法可以在窗体建立后随意改变窗体的风格和颜色。
首先添加一个timer1,下面是timer的代码改变了skinEngine1.SkinFile的属性(kinEngine1是一个改变肤色的扩展控件),注意要把kinEngine1.SkinFile的属性改成你SkinFile所在的绝对路径,SkinFile在附件里面的skin文件夹中。本例中还用到了其他的扩展控件以及本例源码都在附件中。
private void timer1_Tick(object sender, EventArgs e)
        {
            this.count = this.count + 1;
            if (this.count >= 26) { this.count = 0; }
            hsttextbox1.Text = (this.count).ToString("#0");
            switch (this.count)
            {
                case 0:
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\Calmness.ssk";
                    //this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    break;
                case 1:
                    //this.Close();
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\CalmnessColor1.ssk";
                    //this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    new Form1();
                    break;
                case 2:
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\CalmnessColor2.ssk";
                    //this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    new Form1();
                    break;
                case 3:
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\DeepCyan.ssk";
                    //this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    new Form1();
                    break;
                case 4:
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\DeepGreen.ssk";
                    //this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    new Form1();
                    break;
                case 5:
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\DeepOrange.ssk";
                    ///this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    new Form1();
                    break;
                case 6:
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\DiamondBlue.ssk";
                    //this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    new Form1();
                    break;
                case 7:
                    this.skinEngine1.SerialNumber = "";
                    this.skinEngine1.SkinFile = "C:\\Documents and Settings\\vincent\\My Documents\\Visual Studio 2005\\Projects\\clourfulskin\\clourfulskin\\skin\\DiamondGreen.ssk";
                    //this.skinEngine1.SkinStreamMain = ((System.IO.Stream)(resources.GetObject("skinEngine1.SkinStreamMain")));
                    new Form1();
                    break;
                case 8:
                    this.skinEngine1.SerialNumber = "";
           &nb

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 电话:013574892963 QQ:3710167 邮箱:Educs@163.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 Www.myeducs.Cn All Rights Reserved
湘ICP备09003080号