Udostępnij za pośrednictwem


“Listen carefully, I shall say this only once...”

If you are a fan of the old BBC sitcom “Allo Allo” you will most likely recognize the sentence “Listen carefully, I shall say this only once”. If not, please hold on, I promise the rest of this post will make more sense.

In 3.0 a few new methods were introduced on the Box class to allow you to present information to the user and allow the user to choose not to see the same information again. Here is how the call could look:

 Box::infoOnce("Listen carefully", 
              "I shall say this only once...",               'HELP URL',               'Owner'); 

In 4.0 a single new method has been added to the Box class to ask the user yes/no questions and let the user choose to save the answers instead of being asked over and over. Here is how to make the call:

 Box::yesNoOnce("Listen carefully",                "Are you sure you want to ....",                DialogButton::No,                'Owner' /* E.g. formRun.name() */); 

The call will return the saved answer if the user has answered the question once and chosen to not be asked again.

The concept can easily be extended to other combinations of answers, like for example No/Yes/Cancel.

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm

Comments

  • Anonymous
    July 16, 2006
    Hi,

      Your blogs are extremely wonderful and interesting and useful, Thank u
  • Anonymous
    July 25, 2006
    The comment has been removed