Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   TPanel mit schwarzem Rand (https://www.delphipraxis.net/159533-tpanel-mit-schwarzem-rand.html)

hoika 1. Apr 2011 07:52

TPanel mit schwarzem Rand
 
Hallo #,

ich stehe wohl gerade auf dem Schlauch.
Ich will doch nur um mein Panel einen schwarzen Rand haben (so als Trennung),
aber komplett, nicht dieses komische "nur links und oben".

Wie mache ich das denn ?

Danke


#Update:#
Hm, habe mir Funktion geschrieben, die im OnPaint des Forms aufgerufen wird
und die Linien selber malt.


Heiko

Bummi 1. Apr 2011 09:04

AW: TPanel mit schwarzem Rand
 
Quick and Dirty
Delphi-Quellcode:
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
   TPanel= Class(ExtCtrls.TPanel)
    Procedure Paint; override;
  End;

  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TPanel }

procedure TPanel.Paint;
begin
  inherited;
  if Tag = -1 then
    begin
      Canvas.RectAngle(ClientRect);
    end;
end;

end.


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz