Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Button not dimmed

Button not dimmed

Button not dimmed

I have a screen form with a button that I disable if I'm going to add records, otherwise the button is active.

Now, in the When() properties of the button I can disable but the button remains bright, not dimmed.

That's my question: how to dimmed the button ?

Thanks in advance for your help.

RE: Button not dimmed

Try to disable the button not from within the button's When method (since When is activated only when control is passed to this button) but from Click (or other appropriate event)method of the control which make you decide to Add records. Did I make myself clear?

RE: Button not dimmed

Hi Perucha,
  A good programming technique to use, when speaking of enabling/disabling controls, is to use the Refresh() event of the control.

For Example:

If you have a command button you only want enabled when the user has entered something into a text box (example: a password text box and login button), you would put code in the refresh event of the button that looks like this:


In the textbox's Interactive Change event, you would call THISFORM.REFRESH(). This way, anytime the user changes the contents of the textbox, the command button will check and see if it needs to be disabled or enabled.

And in the Form's refresh event, its also good practice to explicitly refresh the controls that have code in their refresh method. Example: In the form's refresh:



RE: Button not dimmed

THANK YOU Jonscott8 !!!

Four days fighting with the little button, the solution it's done.

Thank you Amakovoz too.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close