Autor Beitrag
rafi@work
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Mi 02.07.03 17:11 
Hallo, ich weiss das es bereits einige Threads in diesem Forum gibt über MessageBoxes, nur leider kann ich damit nicht viel anfangen. Kann mir jemand ein Beispiel geben mit "Yes" und "No" Buttons?

mfg
GruppeCN
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 322



BeitragVerfasst: Mi 02.07.03 17:16 
Okay, hier ist dein Beispiel:
ausblenden Delphi-Quelltext
1:
MessageBox(0,'Dies ist ein Test!!!','Hilfe',36);					

Erklärung:
1.- Der Text 'Dies ist ein Test' ist der Text, der in der Ausgabefläche der MessageBox erscheint.
2.- Der Text 'Hilfe' ist der Fenster Titel
3.- Die Zahl 36 gibt an, das ein Yes und ein No Button erscheinen sollen.

_________________
Warum sind die Sachen, die du suchst, immer da, wo du zuletzt nachsiehst?
Weil du aufhörst zu suchen, wenn du sie gefunden hast.
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Mi 02.07.03 17:17 
Hi,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Button1Click(Sender: TObject);
begin
  MessageBox(
               Self.Handle,
               'Das ist eine MessageBox!',
               'Überschrift',
               MB_ICONINFORMATION or
               MB_YESNO
            );
end;


Ich bin mir sicher, dass Dir die Such-Funktion ein ähnliches Ergebnis geliefert hätte.

// Edit: zu langsam
@GruppeCN
Wieso mit Zahlen arbeiten, wenn es selbsterklärende Konstanten gibt
Einfach mal in der Delphi-Hilfe MesageBox eingeben, da sin die meisten Konstanten beschrieben

MFG

- Ernesto -
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Mi 02.07.03 19:16 
danke für eure hilfreichen Beiträge, doch nun habe ich da noch ne frage, wie mache ich, dass wenn ich auf "Yes" klicke einen bestimmten Code aufrufe , und wenn ich auf "No" klicke den anderen, dies ist sicher nicht so schwierig, nur kann ich es mir noch nicht so recht vorstellen..
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Mi 02.07.03 19:20 
ausblenden Delphi-Quelltext
1:
2:
3:
if Messagebox(...) = mrYes then begin
  {...}
end;


mr steht hierbei afaik für Messageresult. Wenn du F1 auf mrYes drückst siehst du die anderen Rückgabecodes :)

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mi 02.07.03 20:11 
schau mal unter MessageDLG in der oh nach. dort ist auch ein praktisches beispiel angeben, was ich mir immer dort raußkopirere:)

_________________
MFG
Michael Springwald, "kann kein englisch...."
yukon-troll
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Mi 02.07.03 20:18 
Hallo rafi@work,

schau dir in diesem Zusammenhang auch mal die Funktion MessageDlg an. Ich benutze zum Erstellen selbiger eigentlich nur noch die GExperts-Tools von www.gexperts.org. Sie beinhalten auch noch viele weitere nützliche IDE-Erweiterungen.

MfG yukon-troll
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Do 03.07.03 07:26 
ich habe nun das Beispiel von "MessageDlg" genommen, doch nun erscheint folgende Meldung:
Zitat:
[Fehler] FormSocketConnect.pas(460): Inkompatible Typen: 'TMsgDlgType' und 'Set'


wie kann ich dieses Problem beheben?

gruss
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 03.07.03 07:35 
Hallo!

rafi@work hat folgendes geschrieben:
ich habe nun das Beispiel von "MessageDlg" genommen, doch nun erscheint folgende Meldung:

Dann hast du das Beispiel aus der Online-Hilfe nicht richtig geändert.

So sieht das Beispiel aus der OH aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
{...}

  if MessageDlg('Willkommen in meiner Object PascalAnwendung. Jetzt beenden?',
    mtConfirmation, [mbYes, mbNo], 0) = mrYes then

{...}

Schau noch mal in Deinem Code nach. Wahrscheinlich hast du die [] vergessen.

Gruß
Tino
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Do 03.07.03 08:02 
das Problem hat sich gelöst! Ich habe den Message Dialog mit dem GExpert erstellt! Danke an alle für eure Hilfe! :D
Smile
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

WinXP
D6 Pers
BeitragVerfasst: Fr 04.07.03 17:30 
GruppeCN hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
MessageBox(0,'Dies ist ein Test!!!','Hilfe',36);					



wo kann man eine Liste der ZahlenCodes finden?
Ich meine z.b. die Bedeutung von der 36!?

_________________
Smile or the day is lost! so -> :)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 04.07.03 17:53 
Smile hat folgendes geschrieben:
Ich meine z.b. die Bedeutung von der 36!?

@GruppeNC: Aus diesem Grund sollte man immer die definierten Konstanten benutzen. :?

Schau mal in der Delphi-Hilfe nach und MessageBox. Dorten sollten die Konstanten aufgelistet sein.

Gruß
Tino
Smile
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

WinXP
D6 Pers
BeitragVerfasst: Fr 04.07.03 18:01 
thx

_________________
Smile or the day is lost! so -> :)
GruppeCN
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 322



BeitragVerfasst: Fr 04.07.03 19:19 
Is ja gut...

_________________
Warum sind die Sachen, die du suchst, immer da, wo du zuletzt nachsiehst?
Weil du aufhörst zu suchen, wenn du sie gefunden hast.