Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Операционные системы > Софт
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 05.12.2009, 14:43   #11
Arigato
Высокая репутация
СуперМодератор
 
Аватар для Arigato
 
Регистрация: 27.07.2008
Сообщений: 15,551
По умолчанию

А у Вас дистрибутив Делфи без хэлпа?
Arigato вне форума Ответить с цитированием
Старый 05.12.2009, 14:44   #12
Черничный
Форумчанин
 
Регистрация: 27.01.2007
Сообщений: 293
По умолчанию

Я почитал его, там какие-то простенькие конструкции описаны и все. Про второй вариант вообще ничего толком не написано
Черничный вне форума Ответить с цитированием
Старый 05.12.2009, 14:51   #13
Arigato
Высокая репутация
СуперМодератор
 
Аватар для Arigato
 
Регистрация: 27.07.2008
Сообщений: 15,551
По умолчанию

ShowMessage
Код:
Displays a message box with an OK button.

Unit

Dialogs

Category

dialog and message routines

procedure ShowMessage(const Msg: string);

Description

Call ShowMessage to display a simple message box with an OK button. The name of the application's executable file appears as the caption of the message box. 

Msg parameter is the message string that appears in the message box. 

Note:	To display a message in a message box with other buttons, or with an icon, use the MessageDlg function.
Note:	If the user types Ctrl+C in the message box, the text of the message is copied to the clipboard.

The following example uses an edit control and a button on a form. When the button is clicked, the current directory and the Windows directory are searched for the filename specified in the edit control. A message box indicates whether the file is found.

procedure TForm1.Button1Click(Sender: TObject);

var
  buffer: array [0..255] of char;
  FileToFind: string;
begin
  GetWindowsDirectory(buffer, SizeOf(buffer));
  FileToFind := FileSearch(Edit1.Text, GetCurrentDir + ';' + buffer);
  if FileToFind = '' then
    ShowMessage('Couldn''t find ' + Edit1.Text + '.')
  else
    ShowMessage('Found ' + FileToFind + '.');

end;
Arigato вне форума Ответить с цитированием
Старый 05.12.2009, 14:52   #14
Arigato
Высокая репутация
СуперМодератор
 
Аватар для Arigato
 
Регистрация: 27.07.2008
Сообщений: 15,551
По умолчанию

MessageDlg
Код:
Displays a message dialog box in the center of the screen.

Unit

Dialogs

Category

dialog and message routines

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. 

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:

TMsgDlgBtn Value	Corresponding return value

mbOK	mrOk
mbCancel	mrCancel
mbYes	mrYes
mbNo	mrNo
mbAbort	mrAbort
mbRetry	mrRetry
mbIgnore	mrIgnore
mbAll	mrAll
mbNoToAll	mrNoToAll
mbYesToAll	mrYesToAll

Note:	If the user types Ctrl+C in the message box, the text of the message is copied to the clipboard.

This example uses a button on a form. When the user clicks the button, a message box appears, asking if the user wants to exit the application. If the user chooses Yes, another dialog box appears informing the user the application is about to end. When user chooses OK, the application ends.

procedure TForm1.Button1Click(Sender: TObject);

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;
Arigato вне форума Ответить с цитированием
Старый 05.12.2009, 14:52   #15
Arigato
Высокая репутация
СуперМодератор
 
Аватар для Arigato
 
Регистрация: 27.07.2008
Сообщений: 15,551
По умолчанию

MessageBox
Код:
Displays a specified message to the user.

function MessageBox(const Text, Caption: PChar; Flags: Longint = MB_OK): Integer;

Description

Use MessageBox to display a generic dialog box a message and one or more buttons. Caption is the caption of the dialog box and is optional.

MessageBox is an encapsulation of the Windows API MessageBox function. TApplication’s encapsulation of MessageBox automatically supplies the missing window handle parameter needed for the Windows API function.

The value of the Text parameter is the message, which can be longer than 255 characters if necessary. Long messages are automatically wrapped in the message box. 

The value of the Caption parameter is the caption that appears in the title bar of the dialog box. Captions can be longer than 255 characters, but don't wrap. A long caption results in a wide message box.

The Flags parameter specifies what buttons appear on the message box and the behavior (possible return values). The following table lists the possible values. These values can be combined to obtain the desired effect.

Value	Meaning

MB_ABORTRETRYIGNORE	The message box contains three push buttons: Abort, Retry, and Ignore.
MB_OK	The message box contains one push button: OK. This is the default.
MB_OKCANCEL	The message box contains two push buttons: OK and Cancel.
MB_RETRYCANCEL	The message box contains two push buttons: Retry and Cancel.
MB_YESNO	The message box contains two push buttons: Yes and No.
MB_YESNOCANCEL	The message box contains three push buttons: Yes, No, and Cancel.

MessageBox returns 0 if there isn’t enough memory to create the message box. Otherwise it returns one of the following values:

Value	Numeric value	Meaning

IDOK	1	The user chose the OK button.
IDCANCEL	2	The user chose the Cancel button.
IDABORT	3	The user chose the Abort button.
IDRETRY	4	The user chose the Retry button.
IDIGNORE	5	The user chose the Ignore button.
IDYES	6	The user chose the Yes button.
IDNO	7	The user chose the No button.
Arigato вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Генератор паролей artyomz JavaScript, Ajax 0 15.10.2009 19:01
Генератор чисел. TheWanderer Общие вопросы C/C++ 13 16.10.2008 16:49
Генератор?? Нестер Софт 5 10.07.2008 13:32
Генератор warlok Общие вопросы Delphi 3 30.05.2008 00:53
Генератор паролей Dimixis Помощь студентам 2 03.07.2007 13:08