• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C#启动画面制作

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
新建C# Windows应用程序。
把图标文件ABC.ico和背景图片hy.bmp复制到目录下,
属性->复制到输出目录->始终复制
右击项目->属性->应用程序->图标和清单->图标,修改为ABC.ico
背景图片大小352*302把窗体的size属性也修改为352*302
窗体代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Diagnostics;
using Microsoft.Win32;

namespace StartSetup
{
    
public partial class FrmStart : Form
    {
        
int iCount = 0;
        
public FrmStart()
        {
            InitializeComponent();
            
//启动画面
            this.FormBorderStyle = FormBorderStyle.None;//去掉外框
            this.BackgroundImage = Image.FromFile("hy.bmp");//背景图片
            this.StartPosition = FormStartPosition.CenterScreen;//屏幕中央
        }

        
private void FrmStart_Load(object sender, EventArgs e)
        {
            
//启动定时器
            timer1.Start();
            timer1.Interval 
= 100;
        }

        
private void timer1_Tick(object sender, EventArgs e)
        {
            
if (iCount > 700)
            {
                Application.Exit();
//启动动画完了之后..
                return;
            }
            iCount 
+= 10;
            
this.Opacity = 1 - Convert.ToDouble(iCount) / 1000;//窗体透明度减小
        }
    }
}
源码:https://files.cnblogs.com/greatverve/StartSetup.rar

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap