Results 1 to 4 of 4

Thread: set no response for for an event?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2009
    Location
    Australia
    Posts
    130

    set no response for for an event?

    Hi folks.

    I have a calculator program, and if the user has already pressed the decimal button, and then presses it again, I want nothing to happen(whatever is displayed in the display label remains unchanged).

    When the user clicks the decimal button the first time, a boolean is changed to true, so that the program knows there is already a decimal.

    Is there a "do nothing" property for an event?

    ie.

    If decimalClicked Then
    Do Nothing
    End If

    Thanks in advance.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,677

    Re: set no response for for an event?

    Use a Boolean variable to check if the decimal button has already been pressed. only check to see if it has not been clicked and don't bother to check if it has been clicked.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2009
    Location
    Australia
    Posts
    130

    Re: set no response for for an event?

    Hi dday9,

    Thanks for your reply.

    Generally, is there an option for an event handler to do nothing? So if a button is clicked, is there a method that can be set to do nothing(not respond)?

    Thank you.

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,677

    Re: set no response for for an event?

    No. The event gets raised every time. It is up to you, the programmer, to do an action or not to do an action when the event gets raised.

    Another option that you have is to set the enabled property to false after it has been clicked. This will make it so that the button can only be pressed once.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width