Autor Beitrag
Fighti
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win 2000 / SuSE Linux 8.2 (dualboot)
Delphi 7 Pro / Kylix 3 Pro
BeitragVerfasst: Mo 19.12.05 15:46 
Hallo

ich habe ein problem mit showmessage. denn ich habe eine applikation in der eine meldung ausgegeben werden soll ohne dass das programm blockiert wird. (also dass es im hintergrund weiterläuft)

kann mir da jemand weiter helfen?

Danke!

gruss fighti

_________________
ja ja sagten sie, haben bezahlt und sind gegangen...
Seraph
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 163

Windows.:siXPack:.
Delphi7 Professional
BeitragVerfasst: Mo 19.12.05 15:49 
Ja die Lösung liegt auf der Hand:

Erstelle eine neue Form, die den gewünschten Text in einem Label ausgiebt!

Die andere Form wird weiter ausgeführt, wenn du nix änderst! :wink:

Seraph

_________________
Wer früher stirbt ist länger tot!
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Mo 19.12.05 15:51 
oder mit CreateMessageDialog(...).Show
Fighti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win 2000 / SuSE Linux 8.2 (dualboot)
Delphi 7 Pro / Kylix 3 Pro
BeitragVerfasst: Mo 19.12.05 16:28 
nun ja, gibt es keine variante bei der man kein neues form erstellen muss....

und CreateMessageDialog funktioniert zwra, aber wenn man auf dem ok button clickt schliesst sich die meldung nicht mehr...

_________________
ja ja sagten sie, haben bezahlt und sind gegangen...
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mo 19.12.05 16:35 
Ja klar, normalerweise setzt der OK-Button einfach ModalResult auf mrOK. Da das Fenster aber nicht modal ist, hat das keine Auswirkungen. Der OK-Button muss einfach Close aufrufen.

Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
Fighti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win 2000 / SuSE Linux 8.2 (dualboot)
Delphi 7 Pro / Kylix 3 Pro
BeitragVerfasst: Mo 19.12.05 17:05 
@Stefan.Buchholtz

und wie mach ich das?

_________________
ja ja sagten sie, haben bezahlt und sind gegangen...
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 19.12.05 21:53 
user profile iconFighti hat folgendes geschrieben:
@Stefan.Buchholtz

und wie mach ich das?

So wie man immer Ereignis-Behandlungsroutingen schreibt. Doppelt draufklicken und Close; reinschreiben :roll:
Seraph
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 163

Windows.:siXPack:.
Delphi7 Professional
BeitragVerfasst: Di 20.12.05 09:19 
Also ich weiß garnicht, was du für ein Problem mit dem Selberbauen einer MessageBox hast?!?

Die Arbeit ist echt minimal:

1. Du erstellst ein neues Formular unter Datei\Neu >\Formular
2. Du setzt auf das neue Formular (nennen wir es Form2) ein Label (label1)
und einen Button (Button1)
3. Design anpassen...
4. In der Form, von dem die MessageBox aufgerufen werden soll, musst du
Form2 "includen":

oben bei uses
ausblenden Delphi-Quelltext
1:
2:
3:
uses
            Windows, Messages, SysUtils, Variants, Classes, Graphics,  
            Dialogs, Controls, Forms, StdCtrls, Form2;



5. Du musst eine Funktion in der Form erstellen, von der aus du die MessageBox
aufrufen willst! Die kann so aussehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
function SelfmMessageBox(MessageText: String; MessageCaption:String):String
begin
 with Form2 do //bedeutet, dass vor alles "Form2." gesetzt wird! 
  begin
   Caption := MessageCaption;
   Label1.Caption := MessageText;
   Show();
 end;
end;



6. Jetzt benötigst du noch einen Funktionsaufruf, den machst du in dem Event,
in dem die Box aufgerufen wird! Beispielsweise so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  SelfmMessageBox('Sie haben eine Messagebox gebaut!''MessageBox');
end;


7. Am Schluss musst du natürlich noch dran denken, dass sich die MessageBox
bei einem Click auf den Button1 wieder schliesst!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm2.Button1Click(Sender: TObject);
begin
  Close;
end;