Home > Software engineering >  MFC dialog box to add background edit box to be affected in the future
MFC dialog box to add background edit box to be affected in the future

Time:09-27

To the dialog box to add the background bitmap images, but lead to click on the edit box input becomes black, delete the input sensitivity also fell, and is there a way to solve? The couple, forgive me

CodePudding user response:

So how did you add the background image? Are there any code stick out to see?
Nothing, it is estimated that it is difficult to help get you

CodePudding user response:

to achieve transparent dialog box when the bitmap as a background of control

CodePudding user response:

Properties dialog to add WS_CLIPCHILDREN | WS_CLIPSIBBING

CodePudding user response:

Do you want to Edit controls the background transparent
Add OnCtlColor function, and then put inside the control background transparent,
Reference:
 
UINT id=pWnd - & gt; GetDlgCtrlID ();
If (id==IDC_EDIT_Temp | | id==IDC_EDIT_Mai | | id==IDC_EDIT_Spo | | id==IDC_EDIT_XinLv | | id==IDC_EDIT_HuXi | | id==IDC_EDIT_AvgY
| | id==IDC_STIME)
{
PDC - & gt; SetBkMode (TRANSPARENT);
The CDC * dc GetDC ();
PDC - & gt; SetTextColor (RGB (140, 140, 140));

CFont font;
The font. CreatePointFont (130, "the official script");//
PDC - & gt; SelectObject (& amp; The font);//set the font
The SetFont (& amp; The font, 0);
ReleaseDC (dc);
Gets=(HBRUSH) : : GetStockObject (NULL_BRUSH);
}
Return gets;

CodePudding user response:


The first picture, the cursor a edit box it is automatically turned black; The second image, still show after delete text content

About the background to add is the code that I use http://blog.csdn.net/amusi1994/article/details/53729776

CodePudding user response:

reference 1st floor JSZJ response:
that you is how to add a background image? Are there any code stick out to see?
Nothing, it is estimated that it is difficult to help get you


Is this blog http://blog.csdn.net/amusi1994/article/details/53729776

CodePudding user response:

In fact is a simple method to estimate is feasible, place of the parent class dialog CHtmlDialog, then add the background image in the HTM page, so don't need any other code

CodePudding user response:

The blog has such branches:
If (pWnd==this)
{
PDC - & gt; SetBkMode (TRANSPARENT);
Return gBr.//the main window using the background brush
}
The else
{
PDC - & gt; SetBkMode (TRANSPARENT);
Return (HBRUSH) : : GetStockObject (NULL_BRUSH);//other controls use transparent background
}
Don't know the original poster notice no
  • Related