![]() |
Re: Formular Ableiten
Zitat:
Zitat:
Ein kleines Problem habe ich aber noch beim Zeichnen wird die Grösse des Formulars verändert wird nicht immer ganz sauber gezeichnet. Grüsse Adrian |
Re: Formular Ableiten
Das Problem beim der Formulargrössenänderung lässt sich mit dem Überschreiben von
procedure Resizing(State: TWindowState); override; und einem Refresh lösen. Grüsse Adrian |
Re: Formular Ableiten
Hallo
Hier mein Aktueller Code, hat jemand noch ne idee denn das WMPaint scheint mir nicht Optimal zu sein. Beim Anklicken von Kombos auf dem Form gibts Grafik Fehler und das Form wird nicht richtig gezeichnet! Bin um jede Hilfe dankbar... Grüsse Adrian
Delphi-Quellcode:
unit DescendantForm;
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms; type TCustomNewDescendantForm = class(TForm) private fContentWindow : Boolean ; procedure SetContentWindow(const Value: Boolean); procedure WMPaint(var msg: TWMPaint); message WM_PAINT; protected procedure Paint; override; procedure Resizing(State: TWindowState); override; property ContentWindow : Boolean read fContentWindow write SetContentWindow; public constructor Create(aOwner: TComponent); override; destructor Destroy; override ; end; TNewDescendantForm = class(TCustomNewDescendantForm) published property ContentWindow : Boolean read fContentWindow write SetContentWindow; property OnPaint; property OnResize; end; implementation { TCustomNewDescendantForm } constructor TCustomNewDescendantForm.Create(aOwner: TComponent); begin Inherited; end; destructor TCustomNewDescendantForm.Destroy; begin Inherited; end; procedure TCustomNewDescendantForm.Paint; var xPoint1 : TPoint ; xRect1 : TRect ; begin Color := clWhite ; aRect1.Left := 0 ; aRect1.Top := 0 ; aRect1.Bottom := ClientHeight ; aRect1.Right := ClientWidth ; Canvas.Brush.Color:= clWhite ; Canvas.FillRect( aRect1 ) ; Canvas.Pen.Color := clBlack ; Canvas.RoundRect(2, 2, ClientWidth - 2, ClientHeight - 2, 20, 20); aPoint1.X := 2 ; aPoint1.Y := 100 ; Canvas.Pen.Color := clBlack ; ; Canvas.PenPos := aPoint1 ; Canvas.LineTo(ClientWidth - 2 , 100) ; Canvas.Brush.Color:= clRed ; ; Canvas.FloodFill(10,10,clWhite,fsSurface) ; end; procedure TCustomNewDescendantForm.Resizing(State: TWindowState); begin Refresh; Inherited; end; procedure TCustomNewDescendantForm.SetContentWindow(const Value: Boolean); begin fContentWindow := Value ; end; procedure TCustomNewDescendantForm.WMPaint(var msg: TWMPaint); begin Inherited ; Paint; end; end. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:05 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz