全部窗体可使用鼠标中移动

2016-02-19 17:26 3 1 收藏

今天图老师小编给大家介绍下全部窗体可使用鼠标中移动,平时喜欢全部窗体可使用鼠标中移动的朋友赶紧收藏起来吧!记得点赞哦~

【 tulaoshi.com - 编程语言 】

  最简单的办法就是"欺骗"系统,让他认为点中的是窗体的标题行

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

  

unit Dragmain;interfaceusesSysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,Forms, Dialogs, StdCtrls;typeTForm1 = class(TForm)Button1: TButton;procedure Button1Click(Sender: TObject);privateprocedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest;end;varForm1: TForm1;implementation{$R *.DFM}procedure TForm1.WMNCHitTest(var M: TWMNCHitTest);begininherited; { call the inherited message handler }if M.Result = htClient then { is the click in the client area? }M.Result := htCaption; { if so, make Windows think its }{ on the caption bar. }end;procedure TForm1.Button1Click(Sender: TObject);beginClose;end;end.{ 下面是这个窗体的设置}object Form1: TForm1Left = 203Top = 94BorderIcons = []BorderStyle = bsNoneClientHeight = 273ClientWidth = 427Font.Color = clWindowTextFont.Height = -13Font.Name = SystemFont.Style = []PixelsPerInch = 96TextHeight = 16object Button1: TButtonLeft = 160Top = 104Width = 89Height = 33Caption = CloseTabOrder = 0OnClick = Button1Clickendend

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

来源:https://www.tulaoshi.com/n/20160219/1615198.html

延伸阅读
'分割区的宽度 PrivateConstSPLITTERWIDTH=45 '最小移动宽度 PrivateConstHMIN=15 'picLeft和picRight的宽度相对于窗体的比例 PrivatePercentAsSingle '正在拖动的标志 PrivateDragFlagAsBoolean '每次拖动后需要重排窗体上的控件 PrivateSubRedrawMe() DimNewWidthAsSingle ...
Dimi,x1AsDouble,y1AsDouble,x2AsDouble,y2AsDouble PrivateSubForm_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle) i=1 x1=X y1=Y EndSub PrivateSubForm_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle) Ifi=1Then x2=X-x1 form1.lift y2=Y-y1 form1.top form1.movex2,y2 ...
Win7系统下删除电脑中移动存储设备(U盘)使用记录的方法   1、打开计算机管理,将可移动存储相关的信息都删除掉; 2、清除注册表法,首先以管理员账户登录,然后打开开始-运行,在对话框中输入regedit,回车打开注册表编辑器(这里涉及注册表安全,防止新手操作出错,建议事先备份注册表); 3、然后点击上方的编辑--查找中...
  unit Unit_Mouse; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,   Dialogs, StdCtrls, Menus;  {=======================================================   DESIGN BY :  花好月圆 / 玉面书生   DATE:  ...
使用鼠标怎么预防鼠标手 鼠标周围太乱容易伤着手腕 上班族常把文件、电话、水杯等放在右手边方便够到的地方,殊不知,这样极易让你患上“鼠标手”。 使用鼠标时,应避免手腕长期处于弯曲姿势,应放置腕垫,承托手掌下方的肌肉,而并非手腕位置;鼠标则要就近放,并保持手腕平直,避免前臂过度伸展。若鼠标活动...

经验教程

991

收藏

62
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部