Autor Beitrag
Schuster
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Mo 11.07.05 13:25 
Hallo,

habe wiedermal ein Problem.

Wie kann ich eine Bestimmte Komponente finden.

Z.b.
eine Komponente die in einem Datenmodul sitzt sucht eine and. Komponente die irgendwo in einem
Formular sitzt aber die Formularnamen nicht namentlich bekannt sind.

Habs so probiert funkt aber nicht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
      for x:=0 to Application.ComponentCount-1 do
      if application.Components[x] is TMaxMySqlGrid then   //Prüfen welche v. meinen Grid sind
      begin
         if (application.Components[x] as TMaxMySqlGrid).Datasource.Name = Self.name then
         begin
           result:= application.Components[x]; //.Name
           exit;
         end
         else
           result:= nil;
      end;

_________________
Markus
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Mo 11.07.05 13:45 
vllcht so?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
for x:=0 to Application.ComponentCount-1 do                                                                                      for i:= 0 to (Application.Component[x].ComponentCount - 1) do begin
      if application.Components[x].Component[i] is TMaxMySqlGrid then begin  
         if (application.Components[x]].Component[i] as TMaxMySqlGrid).Datasource.Name = Self.name then  
         begin  
           result:= application.Components[x]].Component[i]; //.Name  
           exit;  
         end  
         else  
           result:= nil;  
      end;

_________________
Programmers never die, they just GOSUB without RETURN