c# 无边框窗体的边框阴影
Windows API:
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.Runtime.InteropServices; namespace BaseForm
{
public partial class FormEnumlator : Form
{
public FormEnumlator()
{
InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
SetClassLong(this.Handle, GCL_STYLE, GetClassLong(this.Handle, GCL_STYLE) | CS_DropSHADOW); //API函数加载,实现窗体边框阴影效果
Location = new Point(0,0);
// this.StartPosition = FormStartPosition.Manual;
} private bool _IsMouseDown;
private Point _oldLocation;
private Point _startPoint; #region 窗体边框阴影效果变量申明 private const int CS_DropSHADOW = 0x20000;
private const int GCL_STYLE = (-26);
//声明Win32 API
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SetClassLong(IntPtr hwnd, int nIndex, int dwNewLong);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int GetClassLong(IntPtr hwnd, int nIndex); #endregion protected override void OnLoad(EventArgs e)
{
// base.OnLoad(e);
} private void frmEnumlator_Load(object sender, EventArgs e)
{ }
}
}
c# 无边框窗体的边框阴影的更多相关文章
- winfrom 无边框窗体移动和阴影
无边框窗体移动: //窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [ ...
- 【C#】使用DWM实现无边框窗体阴影或全透窗体
1.无边框窗体阴影,win7(需要开启Aero效果)及以上系统 public class LdwmForm : Form { public LdwmForm() { Initialize(); } / ...
- 无边框窗体和timer控件
一.无边框窗体 1.控制按钮如何制作就是放置可以点击的控件,不局限于使用按钮或是什么别的,只要放置的控件可以点击能触发点击事件就可以了 做的好看一点,就是鼠标移入(pictureBox1_MouseE ...
- C#-WinForm-无边框窗体的移动和阴影-API
//窗体移动API,先导入命名空间,在委托MouseDown事件 //移动前准备 [DllImport("user32.dll")] public static extern bo ...
- winform(无边框窗体与timer)
一.无边框窗体 1.控制按钮如何制作就是放置可以点击的控件,不局限于使用按钮或是什么别的,只要放置的控件可以点击能触发点击事件就可以了 做的好看一点,就是鼠标移入(pictureBox1_MouseE ...
- 【WPF】无边框窗体
之前写了一个支持尺寸变换的无边框窗体的一个基窗体,代码如下: public class LBaseWindow : Window { /// <summary> /// 基窗体 /// & ...
- C# 无边框窗体边框阴影效果
通过下面代码在构造函数中调用方法 SetShadow(); 即可实现无边框窗体的阴影效果了 需要添加命名空间 using System.Runtime.InteropServices; private ...
- 无边框窗体、用户控件、Timer控件
一.无边框窗体1 最大化.最小化以及关闭按钮制作实际上就是更换点击前.指向时.点击时的图片 (1)将图片放在该文件夹的Debug中,获取图片的路径Application.StartupPath + & ...
- WinForm 无边框窗体和timer控件
一.无边框窗体 1.控制按钮如何制作就是放置可以点击的控件,不局限于使用按钮或是什么别的,只要可以点击能触发点击事件就可以了 做的好看一点,就是鼠标移入,移出,按下三个事件会让按钮改变样式 如何获取图 ...
随机推荐
- Emmagee app性能测试工具使用教程
Emmagee app性能测试工具使用教程 by:授客 QQ:1033553122 简介 Emmagee是网易杭州研究院QA团队开发的一个简单易上手的Android性能监测小工具,主要用于监控单个Ap ...
- Expo大作战(二十一)--expo如何分离(detach),分离后可以比react native更有优势,但也失去了expo的部分优势,
简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...
- 从 Azure 下载 Windows VHD
本文介绍如何使用 Azure 门户从 Azure 下载 Windows 虚拟硬盘 (VHD) 文件. Azure 中的虚拟机 (VM) 将磁盘用作存储操作系统.应用程序和数据的位置. 所有 Azure ...
- centos7安装mysql5.7修改设置密码策略
centos7操作系统在安装mysql5.7社区版之后会有默认密码,通过grep命令在mysqld.log文件中即可找到,如下所示: 标识位置即在初始化安装时mysql的默认密码,然后通过mysql ...
- C# socket 发送图片和文件
先说服务端:界面:如图: 界面设计源码 namespace SocketJPGToTxt { partial class Form1 { /// <summary> /// 必需的设计器变 ...
- CSS| 實例---寬度自由調節button,圖片切換
<html lang="en"> <head> <meta charset="utf-8"/> <title>I ...
- java8时间操作
import java.time.*; import java.util.Date; /** * @Auther kejiefu * @Date 2018/5/17 0017 */ public cl ...
- 转:sqlserver 临时表、表变量、CTE的比较
1.临时表 1.1 临时表包括:以#开头的局部临时表,以##开头的全局临时表. 1.2 存储 不管是局部临时表,还是全局临时表,都会放存在tempdb数据库中. 1.3 作用域 局部临时表:对当前连接 ...
- Python邮件发送源码
-- coding:utf-8 -- i = 0 while i < 10: #发送十次 import smtplib from email.mime.text import MIMEText ...
- sysdate()简单用法
环境: create table rq (xm varchar2(10),age number,zw varchar(10),rzrq date);insert into rq values ('小崔 ...