Home > Software engineering >  Click on the button MFC in how to make a call after another function
Click on the button MFC in how to make a call after another function

Time:09-23

Click change background button, pop up a dialog box, want to click on the "blue" Turkey change background, how to deal with, beginners will not do, ask bosses guidance.

CodePudding user response:

The FRAM_BK_COLOR macro definition is modified to a COLORREF variables, in Turkey click the blue button, change the global variable and RedrawWindow pointer (note the window/handle),

More simple, add a COLORREF variables dialog box, click on the change background in CColorDialog dialog box, can choose a color, OK after refresh

CodePudding user response:

SetDialogBkColor (RGB (255255255), RGB (0, 0));

CodePudding user response:

You the background button on the dialog box is the main window? Pop-up window click on the Turkish blue button after you send a custom message to the main window, AfxGetMainWnd () - & gt; PostMessage/SendMessage (,,);

CodePudding user response:

Why not use the system completes the color dialog.
CColorDialog

CodePudding user response:

If you are going to change to which the dialog background, is the main dialog box, there is no need for the pop-up dialog box, if the child dialogs, drawn directly its background is good,

CodePudding user response:

In white text box remember OnCtlColor do the background transparent, look so ugly

 
HBRUSH CFinishWellToFind: : OnCtlColor (CDC * pDC, CWnd * pWnd, UINT nCtlColor)
{
If (pWnd - & gt; GetDlgCtrlID ()==controls ID)
{
PDC - & gt; SetBkMode (TRANSPARENT);//set the background mode to transparent
}
Return (HBRUSH) GetStockObject (NULL_BRUSH);//return an empty brush
}


Can say are you said

CodePudding user response:

Message by pressing the button changes color value, and then to the main window to invalidate switch
  • Related