Другие языки программирования и технологии
Сообщения в Delphi
При вызове процедуры ShowMessage выводится сообщение с кнопкой "ОК". А какая ФУНКЦИЯ нужна для вывода сообщения с кнопками "Да", "Нет", "Отмена"?
Application.MessageBox('Text', 'Caption', MB_YESNOCANCEL);
MessageBox displays a specified message to the user.
function MessageBox(Text, Caption: PChar; Flags: Longint): Integer;
Остальное в справке.
Или использовать APIшную функцию MessageBox()
MessageBox(HANDLE, 'Text', 'Caption', MB_YESNOCANCEL);
The MessageBox function creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons.
int MessageBox(
HWND hWnd,// handle of owner window
LPCTSTR lpText,// address of text in message box
LPCTSTR lpCaption,// address of title of message box
UINT uType // style of message box
);
MessageBox displays a specified message to the user.
function MessageBox(Text, Caption: PChar; Flags: Longint): Integer;
Остальное в справке.
Или использовать APIшную функцию MessageBox()
MessageBox(HANDLE, 'Text', 'Caption', MB_YESNOCANCEL);
The MessageBox function creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons.
int MessageBox(
HWND hWnd,// handle of owner window
LPCTSTR lpText,// address of text in message box
LPCTSTR lpCaption,// address of title of message box
UINT uType // style of message box
);
Вот что написано в справке Delphi 7
function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word;
Description
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 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. For a three button message box, use the syntax containing Button1, Button2, and Button3.
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 (Delphi) or NULL (C++), 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:
TMsgDlgBtn ValueCorresponding return value
mbOkmrOk
mbOKmrOk
mbCancelmrCancel
mbYesmrYes
mbNomrNo
mbAbortmrAbort
mbRetrymrRetry
mbIgnoremrIgnore
mbAllmrAll
mbNoToAllmrNoToAll
mbYesToAllmrYesToAll
Note:If the user types Ctrl+C in the message box, the text of the message is copied to the clipbo
function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word;
Description
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 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. For a three button message box, use the syntax containing Button1, Button2, and Button3.
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 (Delphi) or NULL (C++), 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:
TMsgDlgBtn ValueCorresponding return value
mbOkmrOk
mbOKmrOk
mbCancelmrCancel
mbYesmrYes
mbNomrNo
mbAbortmrAbort
mbRetrymrRetry
mbIgnoremrIgnore
mbAllmrAll
mbNoToAllmrNoToAll
mbYesToAllmrYesToAll
Note:If the user types Ctrl+C in the message box, the text of the message is copied to the clipbo
Вызов диалогового окна
batoon
Похожие вопросы
- Согласны с этим - Глубинные причины ненависти к Delphi/Pascal ?
- Delphi:Прочитал, что если при динамическом создании компонента если указать Name объекта, то в последующем можно ->
- Как в Delphi сделать справку?
- Помогите найти ошибку Delphi легкая программка
- Delphi ПОМОГИТЕ ПОЖАЛУЙСТА!
- Задача на Delphi. Аааа решите пожалуйста :'(
- Про Delphi
- Delphi. Обьясните подробно, что, как, и для чего нужен\используется "while" ?
- Как написать программу на Delphi программа которая бы постоянно висело в памяти и через определенное
- Написание текстового HTML-редактора на Delphi 6