Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how can I make a button greyout in dynamics

Posted on 2011-02-17
6
929 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
ID: 34919447
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
ID: 34920082
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
ID: 34922145
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
LVL 1

Expert Comment

by:bsardeson
ID: 34923553
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
ID: 34928463
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
ID: 34930834
LOL, story of our lives buddy!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protecting vb6 & .Net code Obfuscation 18 152
VB 6 error 5 in windows 10 but not in XP 7 63
Advice in Xamarin 21 97
Send outlook email from VBS Script 2 42
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

860 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