[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Disable/Enable Graphical Pushbutton in Dialog...

Posted on 1998-11-13
4
Medium Priority
?
250 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 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month18 days, left to enroll

830 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