网站导航网学 原创论文 原创专题 网站设计 最新系统 原创论文 论文降重 发表论文 论文发表 UI设计定制 论文答辩PPT格式排版 期刊发表 论文专题
返回网学首页
网学原创论文
最新论文 推荐专题 热门论文 论文专题
当前位置: 网学 > 交易代码 > ASP.Net精品代码 > 正文

c#一种简单快速改变窗体风格和肤色的方法源码及其控件

论文降重修改服务、格式排版等 获取论文 论文降重及排版 论文发表 相关服务

本人初学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

设为首页 | 加入收藏 | 网学首页 | 原创论文 | 计算机原创
版权所有 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2020 myeducs.Cn www.myeducs.Cn All Rights Reserved 湘ICP备09003080号 常年法律顾问:王律师