Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 955
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

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