March 29, 2024, 05:57:47 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Messagebox Flags

Started by GWS, October 17, 2007, 09:31:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

October 17, 2007, 09:31:51 AM Last Edit: May 08, 2016, 02:28:41 AM by GWS
I always have trouble finding these when I need them, so I thought I'd post them here in case anyone else needs them ..   :)

Here are the flag codes for a MessageBox  ..
                         
Ret = MessageBox (win, text, title, {flags} ) 
                         
The flag value is the optional integer or hexadecimal sum of the values below: 
The default value is 0 (only an OK button is used). 
                         
Type of buttons displayed:
 
0 OK button only 
1 OK and Cancel 
2 Cancel, Retry and Ignore 
3 Yes, No and Cancel 
4 Yes and No 
5 Retry and Cancel 
                         
Type of icons displayed :
 
16 Critical message                      (0x10)
32 Question mark                         (0x20)
48 Warning / Exclamation mark       (0x30)
64 Information                             (0x40) 
                         
                         
Set the Default button :
 
0 First button                             (0x0)
256 Second button                      (0x100) 
512 Third button                         (0x200) 
                         
                         
Returned value when the corresponding button is clicked:

1 OK 
2 Cancel 
3 Quit 
4 Retry 
5 Ignore 
6 Yes 
7 No 
                         
                         
(If the dialog box displays a Cancel button, pressing Escape is the same as clicking Cancel) . 
                         
Example: 
                         
Ret = MessageBox(win, "Would you like to delete this item", "Stock Analysis", 0x124)
 
(Box with 2 buttons YES and NO, using the Question mark icon, with the NO button set as the default button).


best wishes,  :)

Graham
Tomorrow may be too late ..