Autor Beitrag
Svenkan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

WinXP
Delphi 7 Enterprise
BeitragVerfasst: Do 08.02.07 15:01 
Hey Leute,
ich bin Dienstag in meinen ersten beiden Informatikstunden angefang, mit Delphi zu programmieren.
Nun hab ich folgende Frage:
Ich habe eine Messagebox für ne kurze Programminfo (kennt ja jeder mit Hilfe --> Über).
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
 Application.MessageBox(
        'Programm: Testprogramm'+#10#13+
        'Version: 1.0'+#10#13+
        'Autor: Sven Kannenberg',
        'Programminfos',
        MB_OK);


An die Stelle des 'Testprogramm' soll nun die Caption eingetragen werden. Wie kann ich das realisieren?
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 08.02.07 15:06 
Hallo!

Ich lös das Ganze immer über Konstanten.

bei mir sieht das dann so aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
 ...
 const pname: string = 'Mein Programm - v';
 const pvers: string = 'x.xx';

 var
  mainform: Tmainform;

 ...

 //Über 
 mainform.caption:= pname + pvers;
 //zusammensetzen


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Svenkan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

WinXP
Delphi 7 Enterprise
BeitragVerfasst: Do 08.02.07 15:16 
Mhm..und wie bekomme ich das jetzt an Stelle des 'Testprogramm'?
Ich hab keine Ahnung, wie ich das da reinsetzen soll :(
Das ist ja leider momentan noch mein komplettes Problem..:(
Zumal: das ist ja leider auch nur wieder per manuelle Eingabe gelöst.
Es soll ja aber die aktuelle application.caption dafür eingesetzt werden.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 08.02.07 15:22 
wieso manuell?

ob du nun die Caption änderst, oder die Konstante bleibt sich gleich!

Über die Konstante ists sogar sicherer!

ausblenden Delphi-Quelltext
1:
 messagebox(application.handle, pchar('Programmname: ' + mainform.caption (oder die Konstante einsetzen), 'Info', MB_IconINFORMATION);					


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Svenkan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

WinXP
Delphi 7 Enterprise
BeitragVerfasst: Sa 03.03.07 16:40 
Habs jetzt einfach über Einbindung eines neuen Formulars gelöst. :)