Winfrom无边框模式下的最大化 最小化 移动 缩放以及多屏不同分辨率支持

本文介绍了如何在Winform无边框模式下实现最大化、最小化、移动和缩放功能,并探讨了如何处理多屏幕不同分辨率的情况。提供了一段C#源代码示例,并附带了源码下载链接。
摘要由CSDN通过智能技术生成

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsBorderNone
{
public partial class Form1 : Form
{
private bool moving = false;
private Point oldMousePosition;
public Form1()
{
InitializeComponent();
}

    const int WM_NCHITTEST = 0x0084;
    const int HTLEFT = 10;
    const int HTRIGHT = 11;
    const int HTTOP = 12;
    const int HTTOPLEFT = 13;
    const int HTTOPRIGHT = 14;
    const int HTBOTTOM = 15;
    const int HTBOTTOMLEFT = 0x10;
    const int HTBOTTOMRIGHT = 17;

    const int WM_GETMINMAXINFO = 0x24;

    public struct PointAPI
    {
        public int x;
        public int y;
    }

    public st
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值