Autor Beitrag
Barret
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 156
Erhaltene Danke: 1

Win XP
D7 Ent
BeitragVerfasst: Mi 21.04.04 08:55 
hallo programmierer
ich wollt mal gern wissen ob es eine möglichkeit gibt objekte auf einer form zu verstecken und sie nur bei einer bestimten anweisung wider sichtbar zu machen z.B. mit buttons
wenn ihr eine möglichkeit wisst könnt ihr ja mal posten

_________________
Wir könnten ja, wenn wir wollten aber wir wollen ja nicht.
It´s not a bug, it´s a feature.
Anfänger
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

WinXP
D3 Prof
BeitragVerfasst: Mi 21.04.04 09:14 
Deine Lösung ist "Visible" Die Eigenschaft enthält soweit ich weiß jedes sichtbare Objekt.
raven_22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 95

Win XP pro
D7 Enterprise
BeitragVerfasst: Fr 23.04.04 16:31 
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:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
unit Unit1;

interface

uses
      ...

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Edit1: TEdit;
    Button1: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Edit1Change(Sender: TObject);

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Button1.Visible:=false; // Button1 unsichtbar
Edit1.Visible:=false;   // Edit1 unsichtbar
Timer1.Enabled:=false;  // Timer1 aus
Timer1.Interval:=2000;  // Timer1 Zeit einstellen
Timer1.Enabled:=true;   // Timer1 ein
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
                       
Edit1.Visible:=true;  // Nach 2 Sekunden wird Edit1 sichtbar

end;

procedure TForm1.Edit1Change(Sender: TObject);
begin
if edit1.GetTextLen > 0 then // Bei mehr als 0 Zeichen taucht Button1 auf
   Button1.Visible:=true     
   else
   Button1.Visible:=false;   // Bei weniger als 0 Zeichen nicht
end;

end.


Gruß raven 8)

Moderiert von user profile iconPeter Lustig (17:33, 23.04.2004): Code- durch Delphi-Tags ersetzt

_________________
---_-= raven_22 =-_---