Solved

how can I make a button greyout in dynamics

Posted on 2011-02-17
6
914 Views
Last Modified: 2012-05-11
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
Comment
Question by:taverny
  • 3
  • 2
6 Comments
 
LVL 14

Accepted Solution

by:
VBClassicGuy earned 300 total points
Comment Utility
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
 
LVL 1

Assisted Solution

by:bsardeson
bsardeson earned 200 total points
Comment Utility
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
 

Author Comment

by:taverny
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Expert Comment

by:bsardeson
Comment Utility
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
 

Author Comment

by:taverny
Comment Utility
I am sorry , it does work my code was written in the wrong procedure so it was not showing .
Thanks
0
 
LVL 1

Expert Comment

by:bsardeson
Comment Utility
LOL, story of our lives buddy!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now