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.控制按钮如何制作就是放置可以点击的控件,不局限于使用按钮或是什么别的,只要可以点击能触发点击事件就可以了 做的好看一点,就是鼠标移入,移出,按下三个事件会让按钮改变样式 如何获取图 ...
随机推荐
- 【python】python中的json、字典dict
定义 python中,json和dict非常类似,都是key-value的形式,而且json.dict也可以非常方便的通过dumps.loads互转.既然都是key-value格式,为啥还需要进行格式 ...
- LeetCode题解之Reorder List
1.题目描述 2.题目分析 首先将链表分为两段,然后将后面的一段反转,再合并两个链表. 3.代码 void reorderList(ListNode* head) { if (head == null ...
- Oracle EBS INV更新保留
CREATE or REPPLACE PROCEDURE UpdateReservation AS -- Common Declarations l_api_version NUMBER := 1.0 ...
- bufferIO,Direct io,mmap, ZeroCopy
1 bufferIO(传统IO),Direct io(干掉内核cache),mmap(大数据映射),zeroCopy(网络IO) 2 linux 5种IO 3NIO 相关知识 这张图展示了mmap() ...
- 学习笔记:The Best of MySQL Forum
http://mysql.rjweb.org/bestof.html I have tagged many of the better forum threads. 'Better' is based ...
- alias 别名
别名的作用: 1.通过给危险命令加一些保护参数,防止人为误操作. 2.把很多复杂的字符串或命令变成一个简单的字符串或命令. alias 用法: 定义别名: alias rm='echo "没 ...
- 常用的 接口访问方法 post 和get
public string GetFunction(string serviceAddress) { HttpWebRequest request = (HttpWebRequest)WebReque ...
- tikv性能参数调优
tiKV 最底层使用的是 RocksDB(tidb3.0版本中将使用tian存储引擎) 做为持久化存储,所以 TiKV 的很多性能相关的参数都是与 RocksDB 相关的.TiKV 使用了两个 Roc ...
- Geth命令用法-参数详解 and 以太坊源码文件目录
本文是对以太坊客户端geth命令的解析 命令用法 geth [选项] 命令 [命令选项] [参数-] 版本 1.7.3-stable 命令 account 管理账户 attach 启动交互式JavaS ...
- ORA-27054错误处理
版权声明:本文为博主原创文章,未经博主同意不得转载.个人技术站点:http://www.ezbit.ren https://blog.csdn.net/joeadai/article/details/ ...