ISDBApplication::MessageBox: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
 (added link to Windows UX Guidelines re message boxes)  | 
				 (→See Also:  Added note re JScript arrays.)  | 
				||
| Line 40: | Line 40: | ||
<source lang="vb">res = SDB.MessageBox( SDB.Localize("Select tracks to be exported, please."), mtError, Array(mbOk))</source>  | <source lang="vb">res = SDB.MessageBox( SDB.Localize("Select tracks to be exported, please."), mtError, Array(mbOk))</source>  | ||
===JScript note===  | |||
Passed array of buttons must be of special <tt>VBSafeArray</tt>. Read more about in [[Scripting Tips & Tricks#JScript|Tips & Tricks – JScript section]].  | |||
===See Also===  | ===See Also===  | ||
*[http://msdn.microsoft.com/en-us/library/windows/desktop/aa511277.aspx MSDN – Windows UX Guidelines for Message Boxes]  | *[http://msdn.microsoft.com/en-us/library/windows/desktop/aa511277.aspx MSDN – Windows UX Guidelines for Message Boxes]  | ||
Latest revision as of 23:06, 25 November 2014
CoClass SDBApplication, Interface ISDBApplication
Function MessageBox(MessageText As String, MsgType As EnumMsgBox, Buttons) As Long
Parameters
| Name | Type | Description | 
|---|---|---|
| MessageText | String | Text to be shown in the message box. | 
| MsgType | EnumMsgBox | Type of the box. Can be one of constants described below. | 
| Buttons | Variant | Array of buttons to be shown, can be any constants described below. | 
Method description
Shows a customized message box and returns information about button that was pressed, which can be one of the following values: mrNone(0), mrOk(1), mrCancel(2), mrAbort(3), mrRetry(4), mrIgnore(5), mrYes(6), mrNo(7), mrAll(8), mrNoToAll(9), mrYesToAll(10), mrOkToAll(110) or mrIgnoreToAll(111).
MsgType constants:
- 0: mtWarning – Icon with yellow exclamation. Use to present a condition that might cause a problem in the future.
 - 1: mtError – Icon with red cross. Use to present an error or problem that has occurred.
 - 2: mtInformation – Icon with small letter „i“. Use to present an useful information.
 - 3: mtConfirmation – Question mark icon. Use to ask user for input.
 - 4: mtCustom – No icon is shown.
 
Button constants:
- 0: mbYes
 - 1: mbYesToAll
 - 2: mbNo
 - 3: mbNoToAll
 - 4: mbOk
 - 5: mbOkToAll
 - 6: mbEdit
 - 7: mbEditToAll
 - 8: mbCancel
 - 9: mbAbort
 - 10: mbRetry
 - 11: mbIgnore
 - 12: mbIgnoreToAll
 - 13: mbAll
 - 14: mbHelp
 
Example code
res = SDB.MessageBox( SDB.Localize("Select tracks to be exported, please."), mtError, Array(mbOk))JScript note
Passed array of buttons must be of special VBSafeArray. Read more about in Tips & Tricks – JScript section.