Questions tagged [cbutton]

CButton is a class that represents a button control in the MFC

CButton is a public class in the MFC that represents the button window class of the Windows API.

32 questions
0
votes
2 answers

yii CButton Column

How do i modify the links inside the CGridview? This is from my view page: $this->widget('zii.widgets.grid.CGridView',…
ChUck_PrOg
  • 331
  • 7
  • 16
0
votes
1 answer

MFC (Windows Mobile). How to create a radio button with custom images and labels for checked and unchecked state?

I tried to create a custom button class and use it. But it works for CBitmapButton class only. Is it possible with subclassing of radio button? My current temporary solution is to extend my custom button class by adding the radio button…
Gargo
  • 704
  • 6
  • 16
0
votes
4 answers

MFC CButton background ignored by Windows 7

To change the appearance (background color and text foreground color) of a MFC checkbox and a radiobutton, I used the following implementation which worked fine in Windows2000, half OK in Windows XP, but not OK in Windows…
Jan Van Overbeke
  • 250
  • 3
  • 12
0
votes
0 answers

how to clip a dynamically created dialog controls

I have a dialog window (MFC, CDialogEx) on which I am displaying some kind of information - mostly text, with some hints about the context (hints made with background color, presence of frames and formatting). Text and everything is written in…
Borek
  • 91
  • 6
0
votes
1 answer

What is the correct return value of the BCM_SETSHIELD Windows API message?

What is the correct return value of the BCM_SETSHIELD message? The documentation at https://learn.microsoft.com/en-us/windows/win32/controls/bcm-setshield states that it returns 1 on success and an error code otherwise, but in my tests it seems to…
Jogy
  • 2,465
  • 1
  • 14
  • 9
0
votes
0 answers

CButton sends WM_PARENTNOTIFY message to ancestors but CMFCButton does not. Why?

I am working on a Windows application (built with VS 2019) that relies heavily on MFC functionality. I have a class that is derived from the CWnd class that contains CMFCButton objects (children) which are defined dynamically within the OnCreate…
0
votes
0 answers

CButton Load HBITMAP and hide normal button background

I have a CButton object. I added a bitmap file to the resource editor. I do the following: CButton m_btnClose; (in header file) if (GetDlgItem(IDC_BUTTON_CLOSE)) { HBITMAP hBMP = LoadBitmapW(AfxGetResourceHandle(),…
user8694-03
  • 359
  • 3
  • 15
0
votes
2 answers

"Debug Assertion Failed" when MFC button control EnableWindow method is used in class constructor

I am using Visual Studio 2019 and building a C++ desktop application. I have a dialog class inherited from CDialogEx. In this class I have a few buttons, i.e. CButton as members. When I use the EnableWindow method in the class constructor, it…
Golden
  • 5
  • 3
0
votes
1 answer

How can I get CMFCButton to look like a standard checkbox?

A standard MFC CButton checkbox on a color background looks like this: I want to get rid of the gray margin, but can't get it to go away. No matter how I set the size of the control it still appears. Changing it to an CMFCButton gives this: …
egrunin
  • 24,650
  • 8
  • 50
  • 93
0
votes
1 answer

MFC: OnNcCreate() not called; need to set BS_OWNERDRAW flag for CButton subclass

I'm not an expert on MFC, but I've made a dozen or so custom controls over the last 15+ years. I've just made a CButton with custom graphics. Here's the problem: Of course I need BS_OWNERDRAW to be set. I have an OnNcCreate() method I've cut and…
Swiss Frank
  • 1,985
  • 15
  • 33
0
votes
2 answers

What is MFC's algorithm or function for calculating controls' highlight, shadow, etc.?

I've made a ColorButton subclass of CButton, setting BS_OWNERDRAW flag in styles. It works fine: I can set its text, background, etc. etc. However I don't want to have to set the minor colors manually (highlight, shadow, etc.) I have a heuristic to…
Swiss Frank
  • 1,985
  • 15
  • 33
0
votes
1 answer

Prompt for confirmation before executing cutsom CbuttonColumn action

I have a custom delete button, all i want is some sort of confirmation before delete action takes place.. I have tried multiple ways of doing so with no success so far. here is my code, I am using CArrayDataProvider thus had to create a template for…
Himanshu97
  • 541
  • 1
  • 9
  • 19
0
votes
1 answer

OwnerDraw CButton mfc focus

With standard buttons if I have OK and Cancel, with default on OK and I press the right arrow the Cancel is focused and pressing enter on the keyboard the Cancel button function is called. This doesn't happen with ownerdraw buttons. If I press the…
SNC
  • 59
  • 2
  • 15
0
votes
1 answer

MFC Toggle Radio Button Is Delayed

I have a radio button that is a CButton in a CDialog. When the user clicks the radio button, the function OnClickedRadioButton is called. Inside OnClickedRadioButton I toggle the button by calling this function: void toggleButton(CButton&…
user3731622
  • 4,844
  • 8
  • 45
  • 84
0
votes
3 answers

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…
Javier De Pedro
  • 2,219
  • 4
  • 32
  • 49