Summary of Delphi VCL Information Tips

Source: Internet
Author: User

I now use two kinds of information tips, one of course, the use of Application.messagebox, is an instant prompt. The other is to put all the errors and warnings together, suitable for large-scale data entry, a hint is too troublesome.      1 Instant tips        I encapsulate Application.messagebox, which parameters in the MessageBox are too many, which have time to remember. Encapsulated as follows:     //General Tips procedure Msginfo (const strinfo,strtitle:string); Beginapplication.messagebox ( Pchar (Strinfo), Pchar (strtitle), MB_OK or mb_iconinformation or mb_defbutton1); end; //warning hint procedure msgwarning ( const strinfo,strtitle:string); Beginapplication.messagebox (Pchar (Strinfo), Pchar (strtitle), MB_OK or Mb_ Iconexclamation or Mb_defbutton1); end; //Error hint procedure msgwrong (const strinfo,strtitle:string); Beginapplication.messagebox (Pchar (Strinfo), Pchar (strtitle), MB_OK or mb_iconexclamation or mb_defbutton1); end;  //confirm prompt, return value idyes to confirm, idno to No, idabort not enough memory to display prompt function msgconfirm (const strinfo,strtitle:string): Integer ; Beginresult: = Application.messagebox (Pchar (Strinfo), Pchar (strtitle), Mb_yesno or mb_iconquestion or mb_defbutton2); end; , of course, can also be added or repaired according to their own ideasChanged, attached to the meaning of the flags parameter behind the MessageBox: MessageBox method   Corresponding object:tapplication  declaration: function MessageBox (Text,caption:pchar ; Flags:word):integer;  function: The MessageBox method can display a dialog box that contains a message and one or more buttons in the dialog box. The MessageBox method is a frequently used method in Tapplication, which contains the Windows API MessageBox functions. Friends who have used windows have seen the MessageBox, and can use VB or Delphi to create them. The following is a combination of some of the values allowed by the flags.   Tagged value/meaning   righteousness  mb_abortretryignore/3 buttons appear: Abort,retry,ignore.  mb_applmodal/The Information box for an application is modal, that is, when the user must click a key before returning to the application, Mb_applmodal is set by the missing value, and the corresponding behavior can be mb_systemmodal or mb_ Taskmodal to change. The  mb_default_desktop_only/info box must appear on the missing desktop, which is a user-registered desktop. The first button of the Mb_defbutton1/info box is the default button. The second button of the  mb_defbutton2/info box is the default button. The third button of the  mb_defbutton3/message box is the default button. The fourth button of the  mb_defbutton4/info box is the default button.  mb_help/Add a Help button on the info box that can cause the Help event when you press F1 or this button.  mb_iconasterisk/Same as mb_iconformation.  mb_iconerror/Same as Mb_iconhand.  mb_iconexclamation/An exclamation point icon appears.  mb_iconhand/Same as mb_iconstop.  mb_iconinformation/appears with a lowercase i icon.  mb_iconquestion/appear a question mark? The icon.  Mb_iconstop/appears with a red fork x icon.  mb_iconwarning/Same as mb_iconexclamation. The  MB_OK/info box appears with a button and the button caption is OK. The  mb_okcancel/info box appears with two buttons, and the button caption is OK and cancel. The  mb_retrycancel/info box appears with two buttons, and the button caption is retry and cancel. The information in the  mb_right/info box is aligned to the right. The text in the  mb_trlreading/info box is aligned to the right of the Hebrew and Arabic systems. The  mb_service_notification/Allow message box is displayed on a desktop that is not registered.  mb_setformeground/Make the Information box the current window.  mb_systemmodal/This information box does not allow the user to perform any other action before it is closed, which can be reserved for very important information.  mb_taskmodal/Same as Mb_applmodal. The  mb_yesno/info box has two buttons, and the button title is Yes and No. There are three buttons in the  mb_yesnocancel/info box, and the button titles are Yes,no and Canel.   The return value type for this property is visible in the following table:  named return values/return value/meaning idabort/0/Not enough memory space to display the information box.  IDABORT/3/user selected the Abort button function.  IDCANCEL/2/user selected the Cancel button function.  IDIGNORE/5/user selected the Ignore button function.  IDNO/7/user selected the No button function.  IDOK/1/user selected the OK button function.  IDRETRY/4/user selected the Retry button function.  IDYES/6/user has selected the Yes button function.   2 give a hint in the form to create a form that gives a memo control to display multiple lines of cue content, with three buttons below: OK, ignore, close. The form gives two integer attributes: the number of warning bars and the number of error bars. When the task is turned off the button is available when the number of error bars = 0 o'clock and the number of warning bars; 0 o'clock warnings are available when the number of error bars = 0 and the number of warning bars = 0 o'clock, make sure the buttons are available. Another ansistring is used to store error and warning messages. When the form is called, each additional error is incremented by 1, the number of warnings plus 1 for each additional warning, and the corresponding display information concatenated into a string.

Delphi VCL Information Tip Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.