呵呵,帮你做了个TPanel的
鼠标右键控制,左键确定。
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Panel1.Cursor = crDefault then
Panel1.Perform(WM_SYSCOMMAND,$F012,0)
else
Panel1.Perform(WM_SYSCOMMAND,$F000+Panel1.Tag,0);
end;
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if (X<8) then
begin
if (Y<8) then
begin
Panel1.Cursor := crSizeNWSE;
Panel1.Tag := 4;
end
else if(Y>Panel1.Height-9) then
begin
Panel1.Cursor := crSizeNESW;
Panel1.Tag := 7;
end
else
begin
Panel1.Cursor := crSizeWE;
Panel1.Tag := 1;
end
end
else if (X>Panel1.Width-9) then
begin
if (Y<8) then
begin
Panel1.Cursor := crSizeNESW;
Panel1.Tag := 5;
end
else if(Y>Panel1.Height-9) then
begin
Panel1.Cursor := crSizeNWSE;
Panel1.Tag := 8;
end
else
begin
Panel1.Cursor := crSizeWE;
Panel1.Tag := 2;
end
end
else
begin
if (Y<8) then
begin
Panel1.Cursor := crSizeNS;
Panel1.Tag := 3;
end
else if(Y>Panel1.Height-9) then
begin
Panel1.Cursor := crSizeNS;
Panel1.Tag := 6;
end
else
begin
Panel1.Cursor := crDefault;
Panel1.Tag := 0;
end
end;
end;