有什么办法 使form.borderstyle =bsNone 时,窗口也可以拖拉???
解决方案 »
- 关于指针释放的问题
- 快疯了,遍历QQ发送消息的窗口 竟然没有写消息界面的句柄?
- Delphi开发Activex DLL控件多线程如何触发事件让JS补抓?
- 用bde连接BDF数据库,出现capability not supported
- fastreport设计时的奇怪问题
- 请问如何在StringGrid控件底部加上一行合计行?
- 用ADO连接Access,Access密码怎样设置,ADO连接又怎样设置?
- 簡繁體轉換
- 如何得到一个类的多个级联父类。例如:从Table1得到TTable、从TTable得到TDBDataSet依次类推!
- TXMLDocument销毁时调用Free出错?
- gif相关问题
- 不使用 /install 服务应用程序如何安装
BorderStyle=bsNone 的窗口 ,我想拖动边缘改变大小 ,看看别人的网站说可以截取消 > 息 ,替换 hittest,可是怎么试也不行。请高手支招 ,谢谢! >确实是要截取 nchittest 消息现在源码附上 :程序中词句未优化。。 unit Resize;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); procedure FormResize(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } lpRect:TRect; mess1:string; procedure hitit(var msg:TWMNCHITTEST); message WM_NCHITTEST; public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.hitit(var msg: TWMNCHITTEST);var pt:TPoint;begin pt.x:=msg.XPos; pt.y:=msg.YPos; pt:=ScreenToClient(pt);
if ptInRect(Rect(lpRect.Right-5,lpRect.Top+5, lpRect.Right+5,lpRect.Bottom-5),pt) then msg.Result:=HTRIGHT; file:// 右边 if ptInRect(Rect(lpRect.Left-5,lpRect.Top+5, lpRect.Left+5,lpRect.Bottom-5),pt) then msg.Result:=HTLEFT; file:// 左边
if ptInRect(Rect(lpRect.Left+5,lpRect.Top-5, lpRect.Right-5,lpRect.Top+5),pt) then msg.Result:=HTTOP; file:// 上边 if ptInRect(Rect(lpRect.Left+5,lpRect.Bottom-5, lpRect.Right-5,lpRect.Bottom+5),pt) then msg.Result:=HTBOTTOM; file:// 下边
if ptinRect(Rect(lpRect.Left-5,lpRect.Top-5, lpRect.Left+5,lpRect.Top+5),pt) then msg.Result:=HTTOPLEFT; file:// 左上角 if ptInRect(Rect(lpRect.Right-5,lpRect.Bottom-5, lpRect.Right+5,lpRect.Bottom+5),pt) then msg.Result:=HTBOTTOMRIGHT; file:// 右下角
if ptInRect(Rect(lpRect.Left-5,lpRect.Bottom-5, lpRect.Left+5,lpRect.Bottom+5),pt) then msg.Result:=HTBOTTOMLEFT; file:// 左下角 if ptInRect(Rect(lpRect.Right-5,lpRect.Left-5, lpRect.Right+5,lpRect.Left+5),pt) then msg.Result:=HTTOPRIGHT; file:// 右上角
end;
procedure TForm1.FormCreate(Sender: TObject);begin lpRect:=ClientRect;end;
procedure TForm1.FormResize(Sender: TObject);begin lpRect:=ClientRect;end;
procedure TForm1.Button1Click(Sender: TObject);begin close;end;
end.一搜就有