VBScript MsgBox function
Pagsasaayos at Paggamit
Ang MsgBox function ay maaaring ipakita ang isang message box, naghihintay sa pag-click ng user ng anumang button, at pagkatapos ay ibalik ang halaga ng pinindot na button.
Ang MsgBox function ay maaaring ibalik ang mga sumusunod na halaga:
- 1 = vbOK - Ang kanyang button ay pinindot para matiyak.
- 2 = vbCancel - Ang kanyang button ay pinindot para kanselahin.
- 3 = vbAbort - Ang kanyang button ay pinindot para itigil.
- 4 = vbRetry - Ang button ng muling subukan ay pinindot.
- 5 = vbIgnore - Ang button ng ignoro ay pinindot.
- 6 = vbYes - Ang button ng oo ay pinindot.
- 7 = vbNo - Ang button ng hindi ay pinindot.
Komentaryo:Kung ang helpfile at context na mga parameter ay naipapagbigay, ang gumagamit ay maaaring mag-click ng F1 key upang tingnan ang tulong.
Paalaala:Mangyaring tingnan ang function ng InputBox.
Pagsusukat
MsgBox(prompt[,buttons][,title][,helpfile,context])
Parametro | Paglalarawan |
---|---|
prompt | Mahalagang itong ipaalam. Ang string expression na ipakita sa dialog box na mensahe. Ang pinakamataas na haba ng prompt ay humigit-kumulang 1024 na character, depende sa lapad ng character na ginamit. Kung may ilang mga linya ang prompt, maaaring paghiwalay ang bawat linya gamit ang carriage return (Chr(13)), line feed (Chr(10)) o kombinasyon ng parehong (Chr(13) & Chr(10)). |
buttons |
Ang eksprasyon ng numero, ay naglalarawan ng bilang ng number at uri ng naipakita na button, uri ng icon, tanda ng pangunahing button at uri ng mensaheng box ng mensahe. Kung binigong ipaalam, ang default na halaga ng buttons ay 0. Ang halaga ng button:
The first group of values (0 - 5) is used to describe the type and number of buttons displayed in the dialog box; the second group of values (16, 32, 48, 64) is used to describe the style of the icon; the third group of values (0, 256, 512) determines the default button; and the fourth group of values (0, 4096) determines the style of the message box. When adding these numbers to generate the buttons parameter value, only one number can be taken from each group. |
title | String expression displayed in the dialog box title bar. If title is omitted, the name of the application is displayed in the title bar. |
helpfile | String expression, used to identify the help file that provides context-related help for the dialog box. If helpfile is provided, context must be provided. Not available on 16-bit system platforms. |
context | Numeral expression, used to identify the context number assigned by the author of the help file to a specific help topic. If context is provided, helpfile must be provided. Not available on 16-bit system platforms. |
Halimbawa
dim answer answer=MsgBox("Hello everyone!",65,"Example") document.write(answer)