//窗体移动API
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int IParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;
[DllImport("user32")]
private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, IntPtr lParam);
private const int WM_SETREDRAW = 0xB; private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
ReleaseCapture();
SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, );
}
}

窗体移动API的更多相关文章

  1. winform 窗体移动API、窗体阴影API

    //窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport ...

  2. C# 窗体常用API函数 应用程序窗体查找

    常用的处理窗体的API函数如下(注意:API函数必须放在窗体中...): 使用C#语言,要引用DllImport,必须要添加using System.Runtime.InteropServices命名 ...

  3. winform窗体之间通过 windows API SendMessage函数传值

    -----------------------------------------------------------‘接收窗体’代码.cs------------------------------ ...

  4. C#-WinForm-无边框窗体的移动和阴影-API

    //窗体移动API,先导入命名空间,在委托MouseDown事件 //移动前准备 [DllImport("user32.dll")] public static extern bo ...

  5. WinForm 窗体API移动 API阴影

    窗体移动 //窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllI ...

  6. WinForm 窗体属性 窗体美化

    WinForm是·Net开发平台中对Windows Form的一种称谓. Windows窗体的一些重要特点如下: 功能强大:Windows窗体可用于设计窗体和可视控件,以创建丰富的基于Windows的 ...

  7. Winform无边框窗体的移动和阴影

    //窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport ...

  8. winform 移动窗体,和窗体阴影(引用)

    无边框窗体移动://窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [D ...

  9. 无边框窗体和timer控件

    一.无边框窗体 1.控制按钮如何制作就是放置可以点击的控件,不局限于使用按钮或是什么别的,只要放置的控件可以点击能触发点击事件就可以了 做的好看一点,就是鼠标移入(pictureBox1_MouseE ...

随机推荐

  1. java基础(59):Eclipse把自动括号匹配改成C++那样的(强迫症,没办法)

    在Eclipse开发环境下依次选择: 1.Windows->Preferences->Java->Code Style->Formatter: 2.在Active Profil ...

  2. centos 关闭不使用的服务

    CentOS关闭服务的方法: chkconfig –level 2345 服务名称 off 服務名稱 建議 說明 acpid 停用 Advanced Configuration and Power I ...

  3. docker 批量删除容器

     docker rm `docker ps -a |awk '{print $1}' | grep [0-9a-z]`

  4. XStream xml转java对象

    1:引入jar qn <dependency> <groupId>xstream</groupId> <artifactId>xstream</a ...

  5. Maven打jar包

    <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactI ...

  6. JSP-07-使用JavaBean封装数据

    7.1 常命包名 Dao 包中的接口(NewsDao)以及类(NewsDaoImpl)注意负责和数据操作相关的事情. Service 包中的接口和类对dao的方法进行封装和调用,注意负责和业务逻辑相关 ...

  7. 《OpenGL游戏编程》第9章-PlanarShadow关键代码注释

    阴影这块确实是难点.说到阴影就必须提到投影矩阵.模板值为1和2时分别渲染.说来话长,仅仅放上代码,供日后查阅. /** 渲染墙面和阴影 */ void CPlanarShadow::Render() ...

  8. OpenStack collectd的从零安装客户端

    1.查看是否需要增加yum 源 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@node-12 ~]# yum search collectd Loaded plugin ...

  9. ID3DXMesh接口 创建自己的立方体网格

    D3DXCreateMeshFVF 首先创建一个ID3DXMesh接口. ID3DXMesh接口的说明可以参数龙书. 这里主要是用代码来讲解: #define VERTEX_FVF (D3DFVF_X ...

  10. 161102、MyBatis中批量插入

    方法一: <insert id="insertbatch" parameterType="java.util.List"> <selectKe ...