cbutton

How to SetFocus to a CButton so that the border and focus dotted line are visible?

I created a simple dialog-based application, and in the default CDialog added three buttons (by drag-and-dropping them) using the Visual Studio editor. The default OK and Cancel buttons are there too. I want to set the focus to button 1 when I click button 3. I set the property Flat to true in the properties for muy buttons. I coded...

How do I get the default check box images?

I'm trying to build an owner-drawn check box using CButton, but since I only want to change the text color, I'd like the check-box marks to remain the same. Is there a command that allows me to retrieve the default check box bitmaps for the platform where the program is running? (alternatively: how could I change only the text color,...

MFC button with Bitmap and text

I have a Custom CButton which loads a bitmap, using CButton::SetBitmap(bitmap); Meanwhile, I want to display a text above the bitmap, on the same button. I tried implementing OnPaint(), but it does not display the text, just the bitmap void CBitmapToggleButton::OnPaint() { CButton::OnPaint(); CPaintDC dc(this); // device cont...

Custom draw button using uxtheme.dll

I have implemented my custom button inheriting from CButton and drawing it by using uxtheme.dll (DrawThemeBackground with BP_PUSHBUTTON). Everything works fine but I have two statuses (Normal and Pressed) which Hot status is the same. It means when the user places the cursor over the button it is drawn alike regardless the button status...