控件大小自由拖放,这样的功能如何实现? 控件有自己的拖动事件,在其中输入改变控件的width及height属性的代码即可,要改变其位置则修改top及left属性。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to xp2001:能不能说具体点? 自己派生一个TCustomButton的Button类,处理WM_NCHITTEST消息 TMyButton = class (TButton) public .... procedure WMNcHitTest(var Msg: TWMNcHitTest); message WM_NcHitTest;............procedure TMyButton.WMNcHitTest(var Msg: TWMNcHitTest); 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) and 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; 求算法 请教,动态数组用完后需要手动释放吗? 如何获取dbgrid中所选数据行的行数? 用什么函数算两个日期之间有多少个月? 请教:XML读写问题 来者有分, listbox 的问题(在线等待,请帮帮忙) 请教,一个设计登录表单的问题 请问有谁知道DELPHI 6 中文版里的帮助手册(中文)那里有下载啊? 在sybase中,如果取得datetime的年月日呢? 如何将某一区域的颜色取反? 原来麻大哥在呀,我是问如何象WORD2000一样的实现打印设置框,有朋友说用printsetup控件,所以我问问。在这里答的话请到“?谁能告诉我printsetup控件哪里有?如何调用?即答即得”拿分。
public
....
procedure WMNcHitTest(var Msg: TWMNcHitTest); message WM_NcHitTest;......
......
procedure TMyButton.WMNcHitTest(var Msg: TWMNcHitTest);
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) and
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;