Solved

Disable/Enable Graphical Pushbutton in Dialog...

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

17 Experts available now in Live!

Get 1:1 Help Now