当前位置:网站首页>Fade in and fade out function of C form (project source code)
Fade in and fade out function of C form (project source code)
2022-04-22 13:01:00 【It technology ape】
Let's see the effect first , I think it's OK

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// Fade out effect hidden
if (Win32.AnimateWindow(this.Handle, 2300, Win32.AW_BLEND | Win32.AW_HIDE)) {
// Fade in effect display
Win32.AnimateWindow(this.Handle, 2300, Win32.AW_BLEND | Win32.AW_ACTIVATE);
}
}
}
public class Win32
{
/// <summary>
/// Perform animation
/// </summary>
/// <param name="whnd"> control handle </param>
/// <param name="dwtime"> Animation time </param>
/// <param name="dwflag"> Animation combination name </param>
/// <returns>bool value , Whether the animation is successful </returns>
[DllImport("user32.dll")]
public static extern bool AnimateWindow(IntPtr whnd, int dwtime, int dwflag);
/// <summary>
/// From left to right
/// </summary>
public const Int32 AW_HOR_POSITIVE = 0x00000001;
/// <summary>
/// Right to left display
/// </summary>
public const Int32 AW_HOR_NEGATIVE = 0x00000002;
/// <summary>
/// Display from top to bottom
/// </summary>
public const Int32 AW_VER_POSITIVE = 0x00000004;
/// <summary>
/// Show... From bottom to top
/// </summary>
public const Int32 AW_VER_NEGATIVE = 0x00000008;
/// <summary>
/// If used AW_HIDE sign , Make the window overlap inward , Shrink window ; Otherwise, make the window expand outward , That is, expand the window
/// </summary>
public const Int32 AW_CENTER = 0x00000010;
/// <summary>
/// Hidden window , By default, the window is displayed
/// </summary>
public const Int32 AW_HIDE = 0x00010000;
/// <summary>
/// Activate window . In the use of the AW_HIDE This sign cannot be used after the sign
/// </summary>
public const Int32 AW_ACTIVATE = 0x00020000;
/// <summary>
/// Use sliding type . The default is scroll animation type . When using AW_CENTER When marking , This sign is ignored
/// </summary>
public const Int32 AW_SLIDE = 0x00040000;
/// <summary>
/// Transparency from high to low
/// </summary>
public const Int32 AW_BLEND = 0x00080000;
}
}
版权声明
本文为[It technology ape]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221253580361.html
边栏推荐
- ROS机器人学习——TF坐标变换
- When doing correlation analysis, how to exclude singular value outliers to increase the accuracy of correlation analysis
- 手把手教你配置哔哔点啥
- R语言编写决策曲线DCA(Decision Curve Analysis)函数、多条决策曲线分析DCA曲线可视化在同一图像中
- Opencv project 1-ocr recognition
- JS foundation 11
- Download and installation of redis
- 摆脱 AI 生产“小作坊”:如何基于 Kubernetes 构建云原生 AI 平台
- vnpy本地導入csv數據
- Interpreting closures from structured context
猜你喜欢
随机推荐
Redis updates the value without updating the time
11. 盛最多水的容器
Leetcode 1768, alternate merge string
从构建到治理,业内首本微服务治理技术白皮书正式发布(含免费下载链接)
Machine learning 7- logistic regression to realize the binary classification of watermelon dataset 2.0
字符串强化训练-拷贝字符串|字符串反转实现
JS foundation 13
redis更新值而不更新时间
机器学习7-逻辑斯蒂回归实现西瓜数据集2.0的二分类
OpenCV函数line()的参数pt1和pt2的类型要求
详解为什么OpenCV的直方图计算函数calcHist()计算出的灰度值为255的像素个数为0
手把手教你配置哔哔点啥
数商云家电商城系统解决方案,优化电器商城采购供应链管理,减低库存提升资金利用率
Redis的下载安装
JS foundation 7
CMD命令与脚本学习笔记_Kali_B站
The difference between let, const and VaR
Get rid of the "small workshop" of AI production: how to build a cloud native AI platform based on kubernetes
Calloc and realloc
Leetcode 695. Maximum area of the island









