?
Solved

Disable/Enable Graphical Pushbutton in Dialog...

Posted on 1998-11-13
4
Medium Priority
?
243 Views
Last Modified: 2013-11-20
I have a dialog that displays records from a MSAccess database using a few static labels, edit fields, and some  graphical record navigation buttons ( |<  <  >  >| ).

I would like to disable the appropriate button according to the record state, ie... If the last record is currently being viewed, then gray-out and disable the Next & Last Record buttons.

I do not want to wipe the image, but display a greyed-out replacement image when the button is disabled.  So, this would not work...

m_IDC_LASTRECORD->EnableWindow(FALSE);

...where m_IDC_LASTRECORD is a pointer object to the CButton class.

The idea is very much like disabling graphical buttons on a toolbar.

Maybe this can be done using the CBitmapButton MFC Class, but the button response is soooooo slow using this class.

Thanks!
0
Comment
Question by:ryane
[X]
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
  • 2
4 Comments
 
LVL 23

Expert Comment

by:naveenkohli
ID: 1324625
I don't see any reason why this won't work.

m_IDC_LASTRECORD->EnableWindow(FALSE);

Try it!
0
 

Author Comment

by:ryane
ID: 1324626
That statement will disable the button, but it wipes the image or makes the image a big block of dark gray.  I want the image to still be there, but in a shade of gray.  This is exactly the same as disabling a graphical button on a toolbar.

When you use that statement with a button that has text, the text will gray out, but when used with an image the button is simply filled with a dark gray.

I appreciate your efforts, but I am looking for a  different method to solve this problem.

-ryane
0
 
LVL 2

Accepted Solution

by:
wyy_cq earned 100 total points
ID: 1324627
CBitmap use four bitmaps.
normal,selected(down),focus ,disable

BOOL LoadBitmaps( LPCTSTR lpszBitmapResource, LPCTSTR lpszBitmapResourceSel = NULL, LPCTSTR lpszBitmapResourceFocus = NULL, LPCTSTR lpszBitmapResourceDisabled = NULL );

hope this function will help you . =)
0
 

Author Comment

by:ryane
ID: 1324628
So, I guess the only possible solution is to use the CBitmapButton Class?

I would love to use this class, but the button press/depress timing is sooooooooooooo slow.

-ryane
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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