Solved

Disable/Enable Graphical Pushbutton in Dialog...

Posted on 1998-11-13
4
241 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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…
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 we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

705 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