Autor Beitrag
hedie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 26.03.05 16:30 
Hallo

Gibt es eine möglichkeit, dass man nicht alle buttons einzeln bezeichnen muss also sowass
ausblenden Delphi-Quelltext
1:
 Button1-Button12.enabled := False;					


hoffe es gibt sowas oder sowas ähnliches
vielen dank im vorraus

Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt.
Moderiert von user profile iconTino: Topic aus Sonstiges verschoben am So 27.03.2005 um 21:12

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 26.03.05 16:31 
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 26.03.05 16:34 
sorry aber hab leider nichts gefunden

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 26.03.05 16:36 
Dann drück in Delphi F1 und gib "FindComponent" in der Suche ein.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 26.03.05 16:40 
Also ich möchte, das wenn ich in meine Projekt einen Button drücke, dass dann alle buttons deaktiviert werden (enabed := false)

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Sa 26.03.05 16:42 
ausblenden Delphi-Quelltext
1:
2:
for i:=1 to 10 do
TButton(FindComponent('Button'+IntToStr(i))).enabled := false;
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 26.03.05 16:42 
Ja, dann benutz doch FindComponent!

ausblenden Delphi-Quelltext
1:
2:
for X := 1 to 10 do
  TButton(Form1.FindComponent('Button' + IntToStr(X))).Enabled := False;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 26.03.05 16:49 
Wenn ich das so mache

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
If PortIn (888) = 4 Then begin
 For X := 1 to 10 do
  TButton(Form1.FindComponent('Button' + IntToStr(X))).Enabled := True;


dann komt der fehler
[Fehler] Unit1.pas(259): Undefinierter Bezeichner: 'X'

weshalb

Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt.

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Sa 26.03.05 16:52 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Timer1Timer(Sender: TObject);
var x:integer;
begin
If PortIn (888) = 4 Then begin
 For X := 1 to 10 do
  TButton(Form1.FindComponent('Button' + IntToStr(X))).Enabled := True;

du musst x als integervariable deklarieren ;)

Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 26.03.05 16:53 
user profile iconhedie hat folgendes geschrieben:
Wenn ich das so mache

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
If PortIn (888) = 4 Then begin
 For X := 1 to 10 do
  TButton(Form1.FindComponent('Button' + IntToStr(X))).Enabled := True;


dann komt der fehler
[Fehler] Unit1.pas(259): Undefinierter Bezeichner: 'X'

weshalb

Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt.


1.) Verwende bitte Delphi-Tags

2.) Du solltest dir wirklich einmal ein Delphibuch kaufen und die Grundlagen studieren. Du benötigst natürlich eine Variable x... :roll:

AXMD
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 26.03.05 16:53 
vielen dank (bin halt noch nicht so gut :oops: )

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Fr 01.04.05 15:21 
Titel: Buch
Apropo Delphi Buch. Schau mal hier.