Whenever a developer wants to create overlapping controls for example a Button with inner buttons, or a slider inside it, he faces a problem that whenever a user clicks on the button inner items disappear. I found a simple solution for this problem, which also prevents any distortions in the drawing if the inner controls.
To manually add a CRgnedButton to your existing Dialog do the following:
Add to your Dialog control the following (after adding a visual Button, using the Visual Editor):
- To the Dialog's header file:
- (under the Dialog class)
- To the Dialog's cpp file:
(under the Dialog DoDataExchange)
DDX_Control(pDX, IDC_BUTTON1, m_Btn1);