手机频道:为您提供一个绿色下载空间! 首页| 软件下载| 文章教程| 应用提交| 最新更新
当前位置:首页 > 手机资讯 > 攻略 > qq怎么移除屏蔽的人_移除屏蔽好友方法,

qq怎么移除屏蔽的人_移除屏蔽好友方法,

来源:天空软件网 更新:2023-09-14

用手机看

扫描二维码随时看1.在手机上浏览
2.分享给你的微信好友或朋友圈

当窗体处于屏幕边缘时隐藏窗口的方法

当把软件窗口拖动到屏幕边缘时,让软件窗体隐藏,鼠标再次悬浮时再把它显示出来,

根据下面的代码给窗体添加一系列事件

具体代码如下:

using System.Runtime.InteropServices;namespace 仿QQ侧边隐藏{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }                public static extern bool ReleaseCapture();                public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);        public const int WM_SYSCOMMAND = 0x0112;        public const int SC_MOVE = 0xF010;        public const int HTCAPTION = 0x0002;        //窗体的宽高        int formwidth;        int formheight;                private void Form1_Move(object sender, EventArgs e)        {            formwidth = this.Width;            formheight = this.Height;            int x = this.Location.X;            int y = this.Location.Y;            if (x <= 0)            {                this.Location = new System.Drawing.Point(0, y);                this.Width = 0;            }            if (y <= 0)            {                this.Location = new System.Drawing.Point(x, 0);                this.Height = 0;            }        }        private void Form1_MouseEnter(object sender, EventArgs e)        {            this.Width = formwidth;            this.Height = formheight;        }        private void Form1_MouseDown(object sender, MouseEventArgs e)        {            ReleaseCapture();            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);        }        private void Form1_MouseLeave(object sender, EventArgs e)        {            int nowx = Cursor.Position.X;            int nowy = Cursor.Position.Y;            if (nowx >= (this.Location.X + this.Width) | nowx <= this.Location.X | nowy <= this.Location.Y | nowy >= (this.Location.Y + this.Height))            {                if (this.Location.X == 0)                {                    this.Width = 0;                }                if (this.Location.Y == 0)                {                    this.Height = 0;                }            }        }        private void button1_Click(object sender, EventArgs e)        {            this.Close();        }    }}

运行起来会发现效果是这样的:

把标题栏去掉

再次运行,调试程序,这个图不太好截,有需要的自己试一下吧。

猜你感兴趣

玩家评论

[!--temp.www_96kaifa_com_cy--]
Copy 2018 www.sky-xz.com. All Rights Reserved. 藏ICP备20000196号   
本站资源均收集整理于互联网,其著作权归原作者所有,如果有侵犯您权利的资源,请来信告知,我们将及时撤销相应资源。