在运行期间也能改变控件的尺寸和位置
就像在设计期间一样。
如何实现这样的功能,各位大侠有何高见?
什么地方有这样的文章?
就像在设计期间一样。
如何实现这样的功能,各位大侠有何高见?
什么地方有这样的文章?
解决方案 »
- 帮忙看一下SQL,解决马上结贴
- 如何使得RichEdit得到焦点时,光标移到所有已输入内容的最后面?
- 这种控件怎么安装?
- 请问分数是用来干什么的,为什么要散分,为什么要接分,分有什么用,请高手指教!!!
- /**********************急!Interbase 的默认DBA密码是什么?*************************/
- dx9该怎么用呢
- JSP系统和IntraWeb子系统的用户信息的兼容问题
- //***哪位给个delphi中hook api的例子**//100分像送啊
- 为什么控件在设计期的效果与运行期的效果不同请帮帮我!!代码如下
- 一个异常问题:
- 请问在做安装文件时如何添加 license 里的内容,我用的是InstallShield.Developer.v7.01
- 求解难度SQL语句.100分赠送.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TMyButton1 = class(TButton)
private
{ Private declarations }
procedure WMHITTEST(var Msg:TWMNCHitTest);message WM_NCHITTEST;//WM_HITTEST;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;procedure Register;implementationprocedure TMyButton1.WMHITTEST(var Msg:TWMNCHitTest);
var
Rct : TRect;
Pt : TPoint;
begin GetWindowRect(Handle,Rct); // Get self Rect; pt.x := Msg.pos.x;
pt.y := Msg.pos.y; if (pt.y > Rct.Bottom - 3) and (pt.x > Rct.right - 3) then // bottom right.
begin
Msg.Result :=HTBOTTOMRIGHT;
exit;
end; if (pt.y < Rct.Top + 3) and (pt.x > Rct.right - 3) then // Top right.
begin
Msg.Result :=HTTOPRIGHT;
exit;
end; if (pt.y > Rct.Bottom - 3) and (pt.x < Rct.Left + 3) then // Bottom left.
begin
Msg.Result :=HTBOTTOMLEFT;
exit;
end; if (pt.y < Rct.Top + 3) and (pt.x < Rct.Left + 3) then // Top left.
begin
Msg.Result :=HTTOPLEFT;
exit;
end; if (pt.x < Rct.Left + 3) then // Show left arrow.
begin
Msg.Result :=HTLEFT;
exit;
end;
if (pt.x > Rct.right - 3) then // Show right arrow.
begin
Msg.Result :=HTRIGHT;
exit;
end;
if (pt.y < Rct.Top + 3) then // Show top arrow.
begin
Msg.Result :=HTTOP;
exit;
end; if (pt.y > Rct.Bottom - 3) then // Show bottom arrow.
begin
Msg.Result :=HTBOTTOM;
exit;
end; // Default is drag control.
if PtInRect(Rct,pt) then Msg.Result :=HTCAPTION;end;
procedure Register;
begin
RegisterComponents('MyComponent', [TMyButton1]);
end;end.
这样的原理是什么?能否告知一二!还请介绍几篇相关的文章。在没有人了
我还想知道的更多。大家能不能关注一下,贴子放了好几天了,只有一个答复!!!
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Width := 100;
Edit1.Height := 50
end;