Autor Beitrag
No0B
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Mo 05.04.10 11:37 
Morsche Männer, würde gerne über meine Form ein Image von unten nach oben laufen lassen, das dann oben verschwindet und unten wieder auftauch. Timer hab ich drin Image auch, aber so gehts nicht. Irgendwelche Idden. Achso wie der Name schon sagt bin ich seit langem erst wieder dabei Delphi zu Programmieren.

Hier mal der Code.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
unit Unit4;

interface

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

type
  TForm4 = class(TForm)
    Timer1: TTimer;
    Image1: TImage;
    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Timer1Timer(Sender: TObject);
  end;

var
  Form4: TForm4;

implementation

uses main;

{$R *.dfm}


procedure TForm4.FormMouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
begin
close;
end;

procedure TForm4.Timer1Timer(Sender: TObject);
begin

 Image1.Top := Image1.Top - 30

end;



end.


Moderiert von user profile iconNarses: Titel geändert, Hilfe braucht jeder.
Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8549
Erhaltene Danke: 478

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 05.04.10 11:46 
Hallo,

das sollte so gehen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm4.Timer1Timer(Sender: TObject);
begin
  if Image1.Top < - Image1.Height then // Image ist nach oben verschwunden
  then
     Image1.Top := Form4.Height // oder halt die Höhe des Controls, wo das Image draufliegt
  else
     Image1.Top := Image1.Top - 30  // Image weiter nach oben schieben
end;

_________________
We are, we were and will not be.
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Mo 05.04.10 11:52 
Ja so gehts, Danke :zustimm: