Einzelnen Beitrag anzeigen

Benutzerbild von Bummi
Bummi

Registriert seit: 15. Jun 2010
Ort: Augsburg Bayern Süddeutschland
3.470 Beiträge
 
Delphi XE3 Enterprise
 
#4

AW: TPanel sizeable machen?

  Alt 17. Jan 2011, 19:26
grade mal aus einer Komponente von mir herauskopiert
Delphi-Quellcode:

Procedure TSQLCreator2.MoveControl(ControlHandle:Integer);
begin
  releasecapture;
  sendmessage(ControlHandle, WM_NCLBUTTONDOWN, 2, 0);
end;



Procedure TSQLCreator2.SizeControl(ControlHandle:Integer);
begin
  releasecapture;
  sendmessage(ControlHandle, WM_syscommand, SC_size+6,-1);
end;

Procedure TSQLCreator2.SizeControlW(ControlHandle:Integer);
begin
  releasecapture;
  sendmessage(ControlHandle, WM_syscommand, SC_size+2,-1);
end;

Procedure TSQLCreator2.SizeControlB(ControlHandle:Integer);
begin
  releasecapture;
  sendmessage(ControlHandle, WM_syscommand, SC_size+8,-1);
end;

EDIT und noch ein Beispieleinsatz
Delphi-Quellcode:
procedure TSQLCreator2.TBLVorMouseDown(Sender: TObject;Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
    if y < TPanel(Sender).Height -10 then
       begin
       SizeControlW(TPanel(Sender).Handle);
       //RepaintLink;
       end
    else if (y > TPanel(Sender).Height -4) and (x > TPanel(Sender).Width -4) then
       begin
       SizeControlB(TSqlBox2(Sender).Handle);
      // RepaintLink;
       end
    else
       begin
       SizeControl(TSqlBox2(Sender).Handle);
     // RepaintLink;
       end;
end;
Thomas Wassermann H₂♂
Das Problem steckt meistens zwischen den Ohren
DRY DRY KISS
H₂ (wenn bei meinen Snipplets nichts anderes angegeben ist Lizenz: WTFPL)
  Mit Zitat antworten Zitat