Autor Beitrag
axellang
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mo 11.08.03 22:40 
Hallo Leute,

wie kann ich die Caption eins Buttons einer Message Dialog verändern?
Ich möchte zum Beispiel aus "Ignore" ein "I don't care" machen.

Wie stelle ich das an?

Grüsse

Axel
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Mo 11.08.03 23:32 
Wenn du deine Anwendung lokalisieren willst, rate ich dir zum Resource DLL Experten, der ab der Pro Version dabei ist.
Andererseits kannst du auch dxgettext zum Übersetzen nehmen.

Wenn du aber nur diesen einen Button übersetzen willst, dann musst du so vorgehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var
  Dlg: TForm;
begin
  Dlg := CreateMessageDialog('Mein Text', mtInformation, [mbYes, mbNo, mbIgnore]);
  try
    TButton(Dlg.FindComponent('Ignore')).Caption := 'I don''t care';
    case ShowModal of
      mrYes: ;
      mrNo: ;
      mrIgnore: ;
    end;
  finally
    Dlg.Free;
  end;
end;

_________________
Ist Zeit wirklich Geld?
axellang Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Di 12.08.03 00:14 
Hallo Andy,

danke für die schnelle Antwort. Leider bekomme ich folgenden Fehler:
Zitat:
Aus einem sichtbaren Fenster kann kein modales gemacht werden.

Axel

Moderiert von user profile iconTino: Quote-Tags hinzugefügt.
axellang Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Di 12.08.03 00:22 
Danke hat sich erledigt.

Fehler lag bei:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  
   case ShowModal of 
      mrYes: ; 
      mrNo: ; 
      mrIgnore: ; 
    end;

Richtig:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  
   case Dlg.ShowModal of 
      mrYes: ; 
      mrNo: ; 
      mrIgnore: ; 
    end;

Danke nochmals
Axel

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.