Solved

Disable/Enable Graphical Pushbutton in Dialog...

Posted on 1998-11-13
4
239 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
  • 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 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

825 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