Dialog Button cannot be a ZERO.

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Dialog Button cannot be a ZERO.

Post by Bob Hansen » Wed Nov 26, 2008 3:59 am

I am embarassed about how much time I lost before I discovered why my button with the value of 0 was not working. But it is true.

It is not documented anywhere, but you cannot use the number 0 as a ModalResult for a Dialog button.

It is documented that the value of 2 is reserved for ESC, closing the Dialog, and the Help file says that ModalResult is a numeric value, but if you use a 0 you will find that the button does not function. So I have found it easier to use 2 for the Close function and start the numbering with 3,4,5, etc., skipping 0 and 1 completely.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts