• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 959
  • Last Modified:

how can I make a button greyout in dynamics

I would like to be able to check if a button is greyout and also make a button greyout for some requirement that I have in my vba.
how can I accomplish this? like in the picture attached
thanks
0
taverny
Asked:
taverny
  • 3
  • 2
2 Solutions
 
VBClassicGuyCommented:
In VB6 (which you probably convert into VBA):

If cmdButon.Enabled Then
   'button is not grayed out
Else
   'button is grayed out
End If

To gray out:

cmdButton.Enabled = False
0
 
bsardesonCommented:
I agree with VBClassicGuy

type "enabled" in your code and hit f1 to see the VB Help File for .Enabled for further details and explicit example.
0
 
tavernyAuthor Commented:
Thanks for your input.
button.enabled works but doesn't make it gray out. it just make it not clickable. I wanted it more like the picture below:
button.JPG
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bsardesonCommented:
look at the other appearance properties then ... something isn't right, it should grey-out.  Can you send us a pic of your button with the button.enable = false please.  I'll look further into it in the morning, I don't have VB at home.
0
 
tavernyAuthor Commented:
I am sorry , it does work my code was written in the wrong procedure so it was not showing .
Thanks
0
 
bsardesonCommented:
LOL, story of our lives buddy!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now