Autor Beitrag
FriFra
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: Fr 07.03.03 14:01 
Ich habe auf meinem Form eine Grafik, welche bei einer Grössenänderung der Form neu gezeichnet werden muss (Stretch=True wäre in meinem Fall ungeeignet).
Kann man irgendwie verhindern, dass das "onResize" Ereigniss praktisch permanent wärend der Grössenänderung aufgerufen wird? Es wäre gut, wenn es ers los ginge, nachdem man die Maustaste wieder loslässt..
Spike
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 69
Erhaltene Danke: 1



BeitragVerfasst: Fr 07.03.03 19:13 
Du könntest im OnResize-Ereigniss einen Timer aktivieren und dort dann prüfen ob sich innerhalb der Timerzeit die Formgröße geändert hat.
Wenn dann das Form innerhalb einer Timerperiode nicht mehr geändert wird - neu zeichnen.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Size.X := Width;
  Size.Y := Height;
end;

procedure TForm1.FormResize(Sender: TObject);
begin
  If not Timer1.Enabled then Timer1.Enabled := true;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  If (Size.X = Width) and (Size.Y = Height) then
  begin
    Timer1.Enabled := false;
    // hier Deine Grafik neu zeichnen
  end else
  begin
    Size.X := Width;
    Size.Y := Height;
  end;
end;


Size ist vom Typ TPoint
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Fr 07.03.03 21:28 
Schreib einen Message-Handler für WM_WINDOWPOSCHANGED...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
FriFra Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: Sa 08.03.03 01:20 
Ich habe den Tip von Spike umgesetzt und es funktioniert hervorragend! ;) Danke
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 08.03.03 01:30 
FriFra hat folgendes geschrieben:
Ich habe den Tip von Spike umgesetzt und es funktioniert hervorragend! ;) Danke

Auch ok... (auch wenns nicht sehr elegant ist!)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!