-
大小: 258KB文件類型: .rar金幣: 2下載: 0 次發布日期: 2021-06-02
- 語言: C#
- 標簽:
資源簡介
漂亮的C#軟件啟動界面特效源碼
這是一個用C#編寫的軟件啟動界面特效,開啟時伴隨窗體漸變和有小變大,關閉時從頂部滑出。是一個很好的界面設計。

代碼片段和文件信息
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;
namespace?kaiqidonghuan
{
????public?partial?class?Formdonghua?:?Form
????{
????????//動畫窗體調用關閉時將向上移出屏幕
????????[System.Runtime.InteropServices.DllImport(“user32“)]
????????private?static?extern?bool?AnimateWindow(IntPtr?hwnd?int?dwTime?int?dwFlags);
????????const?int?AW_HOR_POSITIVE?=?0x0001;
????????const?int?AW_HOR_NEGATIVE?=?0x0002;
????????const?int?AW_VER_POSITIVE?=?0x0004;
????????const?int?AW_VER_NEGATIVE?=?0x0008;
????????const?int?AW_CENTER?=?0x0010;
????????const?int?AW_HIDE?=?0x10000;
????????const?int?AW_ACTIVATE?=?0x20000;
????????const?int?AW_SLIDE?=?0x40000;
????????const?int?AW_BLEND?=?0x80000;
????????//…………………………………………………………
????????public?Formdonghua()
????????{
????????????InitializeComponent();
????????}
????????private?void?Formdonghua_Load(object?sender?EventArgs?e)
????????{
????????????//動畫由小漸大現在取消
????????????AnimateWindow(this.Handle?1000?AW_CENTER?|?AW_ACTIVATE);
????????????//主界面漸變設置
????????????this.jianbian.Enabled?=?true;//讓jianbian的timer值有效
????????????this.Opacity?=?0;
????????????//………………………………………………
????????}
????????private?void?jianbian_Tick(object?sender?EventArgs?e)
????????{
????????????//讓背景由0變到1
????????????if?(this.Opacity?1)
????????????{
????????????????this.Opacity?=?this.Opacity?+?0.05;
????????????}
????????????else
????????????{
????????????????this.jianbian.Enabled?=?false;
????????????}
????????}
????????private?void?Formdonghua_FormClosing(object?sender?FormClosingEventArgs?e)
????????{//關閉時動畫
????????????AnimateWindow(this.Handle?1000?AW_SLIDE?|?AW_HIDE?|?AW_VER_NEGATIVE);
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
-----------?---------??----------?-----??----
???????????????384646????????????????????33
- 上一篇:ZedGraph控件使用方法例程
- 下一篇:WPF數學用直尺
評論
共有 條評論