当前注册人数24501人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB   站内搜索 BBS讨论社区 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到跟多的建议

Form窗口淡入淡出效果源代码(重叠透明)

Fading Forms In and Out

2008年01月25日
C#, C# 2.0, Windows, .NET, .NET 2.0, Visual Studio, GDI+, Dev, Design
这个程序实现.net中form窗口的淡入淡出效果,实现语言是C#,在窗口弹出/打开和关闭的时候,就会实现这种淡入淡出的效果。另外,如果,最小化、恢复,或者失去焦点、得到焦点的时候,都会以半透明等方式出现。

源代码及技术文章下载(请点击下面的原文链接下载)


源码图片
请点击链接查看大图
关键内容
//Performs fade increment.

private void timer_Tick(object sender, EventArgs e)
{
    double fadeChangePerTick = timer.Interval * 1.0 / 1000 / fadeTime;

    //Check to see if it is time to stop the timer

    if (Math.Abs(targetOpacity - this.Opacity) < fadeChangePerTick)
    {
        //There is an ugly black flash if you set the Opacity to 1.0

        if (targetOpacity == 1) this.Opacity = .999;
        else this.Opacity = targetOpacity;
        
        //Process held Windows Message.

        base.WndProc(ref heldMessage);
        heldMessage = new Message();
        
        //Stop the timer to save processor.

        timer.Stop();
    }
    else if (targetOpacity > this.Opacity) this.Opacity += fadeChangePerTick;
    else if (targetOpacity < this.Opacity) this.Opacity -= fadeChangePerTick;
}
从本站下载附件及源代码(1个附件,已经成功下载102次)

最值得关注的外文源代码

Generic TCP/IP Client/Server
Instantly Changing Language in the Form
Not OLE .Net/WPF container of MFC applications
graybox-A pop-up window that doesn't suck
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
所有评论

ˇ!L.aㄨ  2008年12月30日
下载看看~
yudale6805  2008年12月25日
不错哦
ss_geng  2008年12月23日
ok
言一  2008年12月20日
看 看
alpbiz  2008年11月30日
真的很好1
snow518  2008年11月29日
Form窗口淡入淡出效果源代码(重叠透明)
盖茨  2008年11月10日
Form窗口淡入淡出效果源代码(重叠透明)
keywill  2008年11月08日
很好很好。。
keywill  2008年11月08日
很好很好。。
touch  2008年11月05日
还可了!!!
kuku  2008年11月05日
xudongme  2008年10月18日
鞠鹏飞  2008年10月16日
原来以为通用代码,只能一个一个的改!
SXwangxiaoke  2008年10月16日
hao dong xi
鞠鹏飞  2008年10月15日
VS2005里这个功能太好实现了
akailovexp  2008年10月12日
实用啊。。
vermouth  2008年10月07日
good
wildsun  2008年09月17日
添分
leiryhp  2008年08月03日
HB  2008年07月30日
我们的。net是如此的强大
肖林波  2008年07月22日
sdddddddddd
熊猫伸伸腿  2008年07月08日
支持,很好很强大
gorsen  2008年06月28日
yyddyy  2008年06月09日
不错!!!!!
字数在300字内
请如实评论
CopyRight (C) codesoso.com 2007-2008 All Rights Reserved   免责声明