Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 27.11.04 16:41 
Hi, Delpher,

(wie) kann ich die Schriftart einer ShowMessage() verändern?

Danke für Hilfe, Detlef Annies
Basti
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 345

Windows Vista
D2005 Pers, D7 Pers
BeitragVerfasst: Sa 27.11.04 16:48 
Also soweit ich weiss geht das nicht.
Du musst dir dafür ein neues Formulat anlegen und dann halt ein Label drauf
und das über For.Show anzeigen und über den OK Button wieder scließen.

_________________
Der Computer ist die logische Weiterentwicklung des Menschen: Intelligenz ohne Moral.
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Sa 27.11.04 17:34 
So erzeugst du dir selber Dialogs.....
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:
function xMessageDlg(const Msg: string; DlgType : TMsgDlgType;
                     Buttons : TMsgDlgButtons; Captions: array of string; myFont:TFont) : Integer;
var
  aMsgDlg : TForm;
  CaptionIndex,
  i : integer;
  dlgButton : TButton;  // uses stdctrls
begin
  // Dlg erzeugen
  aMsgDlg := CreateMessageDialog(Msg, DlgType, buttons);
  aMsgDlg.Font:=myFont;
  CaptionIndex := 0;
  // alle Objekte des Dialoges testen
  for i := 0 to aMsgDlg.ComponentCount - 1 do begin
    // wenn es ein Button ist, dann...
    if (aMsgDlg.Components[i] is TButton) then begin
      dlgButton := TButton(aMsgDlg.Components[i]);
      if CaptionIndex > High(Captions) then Break;
      // Beschriftung entsprechend Captions-array ändern
      dlgButton.Caption := Captions[CaptionIndex];
      Inc(CaptionIndex);
    end;
  end;
  Result := aMsgDlg.ShowModal;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  erg : integer;
begin
  erg := xMessageDlg('Hier steht der gewünschte Text,' + chr($0D) + 'die Buttons sind geändert',
                      mtConfirmation,
                      [mbYes, mbNo, mbCancel],        // benutzte Schaltflächen
                      ['Alles', 'Teil','Abbrechen'],self.font); // zugehörige Texte
  case erg of                                         // zugehörige Antworten
    mrYes   : ShowMessage('"1" clicked');
    mrNo    : ShowMessage('"2" clicked');
    mrCancel: ShowMessage('"3" clicked');
  end; // of case
end;


entnommen aus DP, leicht verändert