Autor Beitrag
Jelox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 22.03.05 10:57 
hi.
ich bin ja noch nicht lange hier im forum.
also, wenn ich den thread hier flasch reingepostet habe, bitte schieben!!!

also dann werd ich euch mal mein problem beschreiben.

ich möchte, wenn ich auf mein Beenden Button klicke eine messagebox haben, bei der abgefragt wird, ob man das programm wirklich verlassen möchte.
aber irgendwie will das bei mir jetzt gerade nicht richtig funtionieren

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TFLogin.BBeendenClick(Sender: TObject);  
begin  
  MessageBox('Wollen Sie das Programm wirklich beenden?', 'Beenden?', [MB_OKCANCEL]);  
end;


bitte helft mir. ich bin noch ein anfänger.

schonmal ein dickes danke im vorraus.

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Moderiert von user profile iconTino: Titel geändert.
1211chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30

WIN XP Pro, Win 7-64bit Home
D4 Prof
BeitragVerfasst: Di 22.03.05 11:07 
Titel: Nicht box, DLG
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if MessageDlg('Programm beenden ?',mtWarning, [mbYes, mbNo], 0) = mrYes then
  begin
  close;
  Nasenbohren;
  end;


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

_________________
Theorie: Alles läuft ... Praxis: Nix funzt ... Ich bin eben ein Mann der Praxis
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 22.03.05 11:07 
Titel: Re: messagebox problem :(
user profile iconJelox hat folgendes geschrieben:
aber irgendwie will das bei mir jetzt gerade nicht richtig funtionieren

Wie in deinem anderen Thread: Bitte genauer: Was funktioniert nicht?

@1211chef:
Vermutlich richtig geraten.
Kannst du mir die Routine "Nasenbohren" mal rübergeben? Bin gerade erkältet. :wink:
1211chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30

WIN XP Pro, Win 7-64bit Home
D4 Prof
BeitragVerfasst: Di 22.03.05 11:17 
@schlauberger:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var nasenbohren: boolean;
begin
if nasenbohren = true then
  begin
  showmessage ('Du bist ein Nasenbohrer');
  end;


ist doch logisch, oder ??? GRINS

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

_________________
Theorie: Alles läuft ... Praxis: Nix funzt ... Ich bin eben ein Mann der Praxis
Jailbird
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 127

Windows XP Pro SP2
Delphi 7 Professional
BeitragVerfasst: Di 22.03.05 11:29 
ausblenden Delphi-Quelltext
1:
if nasenbohren = true then					


mir stehen die haare zu berge. bitteschön schon so

ausblenden Delphi-Quelltext
1:
if nasenbohren then					
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 22.03.05 11:40 
user profile icon1211chef hat folgendes geschrieben:
@schlauberger:

var nasenbohren: boolean;
begin
if nasenbohren = true then
begin
showmessage ('Du bist ein Nasenbohrer');
end;

ist doch logisch, oder ??? GRINS

wieso schlauberger?
Danke für die Routine. Jetzt bekomme ich wieder besser Luft. :hair:
Ich glaub das war jetzt genug OT.
1211chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30

WIN XP Pro, Win 7-64bit Home
D4 Prof
BeitragVerfasst: Di 22.03.05 11:47 
user profile iconJailbird hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
if nasenbohren = true then					


mir stehen die haare zu berge. bitteschön schon so

ausblenden Delphi-Quelltext
1:
if nasenbohren then					


NEEE, ich leg grossen Wert auf = wahr ! :-)

_________________
Theorie: Alles läuft ... Praxis: Nix funzt ... Ich bin eben ein Mann der Praxis
1211chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30

WIN XP Pro, Win 7-64bit Home
D4 Prof
BeitragVerfasst: Di 22.03.05 11:48 
user profile iconjasocul hat folgendes geschrieben:
user profile icon1211chef hat folgendes geschrieben:
@schlauberger:

var nasenbohren: boolean;
begin
if nasenbohren = true then
begin
showmessage ('Du bist ein Nasenbohrer');
end;

ist doch logisch, oder ??? GRINS

wieso schlauberger?
Danke für die Routine. Jetzt bekomme ich wieder besser Luft. :hair:
Ich glaub das war jetzt genug OT.


Weil mir dein Name nicht mehr einfiel ??? :-) :-)

_________________
Theorie: Alles läuft ... Praxis: Nix funzt ... Ich bin eben ein Mann der Praxis
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Di 22.03.05 11:51 
user profile iconjasocul hat folgendes geschrieben:
Ich glaub das war jetzt genug OT.

Exakt :mahn:

_________________
JSXGraph
Jelox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 22.03.05 11:56 
so ich sag euch einfach mal die fehlermeldungen, die ich bekomme.
1.: Inkompatible Typen: 'HWND' und 'String'
2.: Inkompatible Typen: 'Set' und 'PAnsiChar'

könnt ihr mir da weiterhelfen???
ich bin noch total der anfänger :(
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Di 22.03.05 11:59 
Jelox, du verwendest die Funktion falsch. Sieh bitte in der Hilfe nach, da hat es ein gutes Beispiel.
OH hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Button1Click(Sender: TObject);
begin
  if MessageDlg('Welcome to my Delphi application.  Exit now?',
    mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes then
  begin
    MessageDlg('Exiting the Delphi application.', mtInformation,
      [mbOk], 0, mbOk);
    Close;
  end;
end;
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 22.03.05 12:08 
Also bei mir (in Delphi3) funktioniert der Programmcode nicht.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
MessageDlg('Welcome to my Delphi application.  Exit now?',  
    mtConfirmation, [mbYes, mbNo], 0,mbYes) 

MessageDlg('Exiting the Delphi application.', mtInformation,  
      [mbOk], 0, mbOk);


Der markierte Teil muss raus. Dann geht's.

Moderiert von user profile iconTino: Delphi- und Highlight-Tags hinzugefügt.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Di 22.03.05 12:13 
Das hängt von der verwendeten Unit ab. Offenbar ist das Beispiel nicht für die Unit Dialogs geeignet (sondern QDialogs).
Hier noch das Beispiel mit MessageBox, da das die ursprüngliche Frage war. In diesem Fall ist aber MessageDlg geeigneter.
ausblenden Delphi-Quelltext
1:
2:
3:
 if MessageBox(Handle, PChar('Wollen Sie das Programm wirklich beenden?'),
  PChar('Beenden'), MB_YESNO) = IDYES then
   Close;


//Edit: Oder noch einfacher mit Application.MessageBox


Zuletzt bearbeitet von delfiphan am Di 22.03.05 12:18, insgesamt 1-mal bearbeitet
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 22.03.05 12:16 
Und wo liegt da jetzt das Problem?? :shock:
Jelox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 22.03.05 12:19 
danke das läuft jetzt schonmal :) *freu*