Autor Beitrag
Alexander F
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 149

Win XP, Win 2000
D6 PE, D7 Prof, D8 Prof
BeitragVerfasst: Mo 05.07.04 16:31 
Hallo,
ich habe gerade versucht einen kleinen Rahmen auf dem Canvas des Forms zu malen. Ist ja an sich kein Problem, dann habe ich mich gewundert, warum ich nichts zu Gesicht bekommen habe.
Es scheint daran zu liegen, dass ich den Borderstyle auf bsNone gestellt habe. Aber wieso? Und wie kann ich das beheben?

Ich könnte natürlich auch einfach ein Bild nehmen aber das ist zu unflexibel und unschön...
Alex
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: Mo 05.07.04 16:51 
Hi,

bei mir klappt es ohne Probleme auch mit Borderstyle=bsNone.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormPaint(Sender: TObject);
begin
  Canvas.pen.Width:=5;
  Canvas.Rectangle(0,0,width,height);
end;



Hast du auch beachtet, das der Canvas bei jedem OnPaint wieder gelöscht wird?


Gruß
Alexander F Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 149

Win XP, Win 2000
D6 PE, D7 Prof, D8 Prof
BeitragVerfasst: Mo 05.07.04 17:58 
Das tat weh... Ich dachte ich hätte es ins OnPaint geschrieben, dabei habe ich es ins OnCreate geschrieben, ich Trottel
:shock:

Danke dennoch ;-)