28. september 2001 - 13:39Der er
4 kommentarer og 1 løsning
Messagedlg() syntax
Hej,
Da jeg sidder med min kode, men uden en version af Delphi til at hjælpe mig, mangler jeg syntaxen til messagedlg funktionen samt en minimal fortegnelse på hvad knapperne hedder. Jeg forsøger mig her -
if messagedlg(\'Vil du videre ?\', mtconfirmation, [mbyes, mbno],0) = mryes then showmessage(\'Du er videre\');
Det skal lige siges, at det jeg søger efter er ovenstående kode, compilet osv., dvs. fejlfri. Koden skal bare være uden fejl, da det ikke er mig, der skal compile den... :-)
Call MessageDlg to bring up a message box and obtain the user\'s response.
Caption specifies the caption for the message box when DlgType is mtCustom. If this parameter is not used (the first syntax), the caption for custom message boxes is the title of the application.
Msg is the content of the message that appears.
DlgType indicates the purpose of the dialog.
Buttons indicates what buttons should appear in the message box. Note that if you want to use a three button message box, you can use the last syntax instead, and control the order in which the buttons appear.
Button1, Button2, and Button3 indicate what types of buttons to use for a three button message box. The resulting buttons appear in order.
HelpCtx specifies the context ID for the help topic that should appear when the user clicks the help button or presses F1 while the dialog is displayed.
X and Y specify the screen coordinates where the dialog should appear. A value of –1 means that the message box can appear anywhere in the specified dimension.
DefaultBtn specifies which button from among those specified by Buttons (or Button1, Button2, and Button3) is the default button for the dialog. If DefaultBtn is mbNone, there is no default button.
Bitmap is an image that appears on the face of the message dialog. If Bitmap is nil, there is no image unless DlgType is mtConfirmation.
MessageDlg returns the value of the button the user selected. The following table lists the TMsgDlgBtn values for each type of button that can appear in the message box, and the corresponding value that is returned if the user selects that button:
Call MessageDlg to bring up a message box and obtain the user\'s response.
Msg is the content of the message that appears.
DlgType indicates the purpose of the dialog.
Buttons indicates what buttons should appear in the message box.
HelpCtx specifies the context ID for the help topic that should appear when the user clicks the help button or presses F1 while the dialog is displayed.
MessageDlg returns the value of the button the user selected. The following table lists the TMsgDlgBtn values for each type of button that can appear in the message box, and the corresponding value that is returned if the user selects that button:
begin if MessageDlg(\'Welcome to my Object Pascal application. Exit now?\', mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin MessageDlg(\'Exiting the Object Pascal application.\', mtInformation, [mbOk], 0); Close; end;
end;
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.