如何让一个BorderStyle是BsNone的窗体可以让用户调节窗体大小,即让窗体同时又是Sizeable的?
解决方案 »
- 关于CXgrid的使用教程.
- hook文件API问题?急,高手拜托了阿
- 在网上找到MD5的算法,但不知道怎样调用,有谁可以指明
- 用DELPHI如何实现网页中的<FORM></FORM>中的文件上传动作?请各位高手指点
- 读文本文件最后一行的语法?
- 使用以下語句為什麼不能合併一列呢?????
- adoquery1在执行查询时显示错误:adoquery1:field 'myID' not find.是怎么回事?
- 请各位指教如何在编程访问'outlook/outlook express'的帐户信息。。
- 为什么我的信誉值会下降啊.
- 关于日期查询的一个小问题,大虾们帮点忙吧!!
- 一个关于richedit的小问题,请进来帮帮忙!
- Delphi中的Record问题
详见WinApi帮助-WM_NCHITTESTunit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure WMNCHITTEST(var msg: TMessage); message WM_NCHITTEST;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;procedure TForm1.WMNCHITTEST(var msg: TMessage);
begin
msg.Result := HTBOTTOM;
end;end.
begin
判断鼠标的位置
ReleaseCapture;
PreForm(WM_SYSCOMMAND, Para, 0);
end;Para = $F001..$F008
自己试试看吧
begin
判断鼠标的位置
ReleaseCapture;
PreForm(WM_SYSCOMMAND, Para, 0);
end;Para = $F001..$F008
自己试试看吧
在onmousedown中写如下代码
begin
判断鼠标的位置
ReleaseCapture;
PreForm(WM_SYSCOMMAND, Para, 0);
end;Para = $F001..$F008
自己试试看吧
procedure TFormMain.CreateParams(var Params: TCreateParams);
//change the form style
//2003.02.13
begin
inherited CreateParams(Params);
with Params do
begin
Style:=(Style or WS_POPUP) xor (ws_dlgframe);
ExStyle:=ws_ex_clientedge;
end;
end;
procedure CreateParams(var Params: TCreateParams); override;procedure TfrmMain.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.Style := WS_POPUP or WS_BORDER or WS_SIZEBOX;
end;
var
pt: TPoint;
begin
pt := Point(Msg.xPos, Msg.yPos);
pt := ScreenToClient(pt);
if (pt.x < 5) and (pt.y < 5) then
Msg.Result := htTopLeft
else if (pt.x > Width - 5) and (pt.y < 5) then
Msg.Result := htTopRight
else if (pt.x > Width - 5) and (pt.y > Height - 5) then
Msg.Result := htBottomRight
else if (pt.x < 5) and (pt.y > Height - 5) then
Msg.Result := htBottomLeft
else if (pt.x < 5) then
Msg.Result := htLeft
else if (pt.y < 5) then
Msg.Result := htTop
else if (pt.x > Width - 5) then
Msg.Result := htRight
else if (pt.y > Height - 5) then
Msg.Result := htBottom
else
inherited;
end;