2

I have a CMFCColorButtoninside a CPropertyPage. When I click the button, the color choice popup comes up. I can select a color and the popup closes, I can get the color etc.. all good. But when I click somewhere else while the popup is open, it doesn't close. Which it should - what's going in?

Basti
  • 2,228
  • 1
  • 19
  • 25
  • Sounds like a parenting issue. Check what parent window pointer you're giving to the button and the popup dialog. The parent of both should be the page. – acraig5075 Sep 26 '16 at 07:17

1 Answers1

1

I know this problem from when you use this special popups in a dialog. You must use CDialogEx instead of CDialog.

CDialogEx uses OnNcActivate with a CDialogImpl class that closes popups. As I see the same handling is used in CMFCPropertySheet and CMFCPropertyPage.

SO the solution should be using CMFCPropertySheet and CMFCPropertyPage instead of the CProperty... classes.

xMRi
  • 14,982
  • 3
  • 26
  • 59
  • With a similar fundament, I solved the problem I referenced on http://stackoverflow.com/a/32009058/383779 – sergiol Sep 26 '16 at 23:32