运行程序的时,
在form中点击button后可以产生几个pannel,
现在我想直接在form中改变panel的大小和长短,怎么做啊?
我自己写了一个程序可以单独调整panel的大小,就是不知道怎么把这两个联系起来的。
以下是单独调整panel的程序:
procedure TForm1.Panel2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
if (x>=0)and(x<=3) then
begin
if (y>=0)and(y<=3) then Panel2.Perform(WM_SysCommand,$F004,0);
if (y>3)and(y<Panel2.Height-3) then Panel2.Perform(WM_SysCommand,$F001,0);
if (y>=Panel2.Height-3)and(y<=Panel2.Height) then Panel2.Perform(WM_SysCommand,$F007,0);
end
else if (x>3)and(x<Panel2.Width-3) then
begin
if (y>=0)and(y<=3) then Panel2.Perform(WM_SysCommand,$F003,0);
if (y>3)and(y<Panel2.Height-3) then Panel2.Perform(WM_SysCommand,$F012,0);
if (y>=Panel2.Height-3)and(y<=Panel2.Width) then Panel2.Perform(WM_SysCommand,$F006,0);
end
else if (x>=Panel2.Width-3)and(x<=Panel2.Width) then
begin
if (y>=0)and(y<=3) then Panel2.Perform(WM_SysCommand,$F005,0);
if (y>3)and(y<Panel2.Height-3) then Panel2.Perform(WM_SysCommand,$F002,0);
if (y>=Panel2.Height-3)and(y<=Panel2.Width) then Panel2.Perform(WM_SysCommand,$F008,0);
end;
end;
procedure TForm1.Panel2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if (x>=0)and(x<=3) then
begin
if (y>=0)and(y<=3) then Panel2.Cursor:=crSizeNWSE;
if (y>3)and(y<Panel2.Height-3) then Panel2.Cursor:=crSizeWE;
if (y>=Panel2.Height-3)and(y<=Panel2.Height) then Panel2.Cursor:=crSizeNESW;
end
else if (x>3)and(x<Panel2.Width-3) then
begin
if (y>=0)and(y<=3) then Panel2.Cursor:=crSizeNS;
if (y>3)and(y<Panel2.Height-3) then Panel2.Cursor:=crArrow;
if (y>=Panel2.Height-3)and(y<=Panel2.Width) then Panel2.Cursor:=crSizeNS;
end
else if (x>=Panel2.Width-3)and(x<=Panel2.Width) then
begin
if (y>=0)and(y<=3) then Panel2.Cursor:=crSizeNESW;
if (y>3)and(y<Panel2.Height-3) then Panel2.Cursor:=crSizeWE;
if (y>=Panel2.Height-3)and(y<=Panel2.Width) then Panel2.Cursor:=crSizeNWSE;
end;
end;
刚刚接触delphi,希望大虾们可以帮帮我的。谢谢先