Home > Software engineering >  How to realize the transparent overlapping problem text edit box
How to realize the transparent overlapping problem text edit box

Time:09-28

To achieve a simple chat function, the background for the transparent
HBRUSH gets=CDialog: : OnCtlColor (pDC, pWnd, nCtlColor);
PDC - & gt; SetBkMode (TRANSPARENT);
Gets=(HBRUSH) GetStockObject (NULL_BRUSH);
And then refresh the word began to overlap
Also met this situation before with the following code to solve the
CRect the rect.
GetDlgItem (IDC_XXXX - & gt; GetWindowRect (the rect);
The ScreenToClient (the rect);
The InvalidateRect (the rect);
M_xxx. SetSel (0, 1);
M_xxx. ReplaceSel (cstrings);
Results now useless
Access to the Internet found another string of code also pretty useful
GetDlgItem (IDC_XXXX) - & gt; ShowWindow (SW_HIDE);
GetDlgItem (IDC_XXXXX) - & gt; SetWindowText (cstrings);
GetDlgItem (IDC_XXXX) - & gt; ShowWindow (SW_SHOW);
Well,,, it is useful at the beginning, until after the writing brush has been sent to the bottom bottom brace not actively decline, I looked at it manually pull down, below the overlap again, and when I back brace on heaps, also began to overlap above! Again your refresh
Pray god to help

CodePudding user response:

see half a day did not understand what you want

CodePudding user response:

Is there is no other way to make text overlap of ah,,,

CodePudding user response:

"And then refresh the word began to overlap"
The background erase you deleted, the last of the output text, can't erase, will overlap,

CodePudding user response:

LZ solve didn't? I also encountered the same problem ~ ~ ~ is worried, seeks the solution ~ ~ ~ ~!

CodePudding user response:

GetDlgItem (IDC_XXXX) - & gt; ShowWindow (SW_HIDE);
GetDlgItem (IDC_XXXXX) - & gt; SetWindowText (cstrings);
GetDlgItem (IDC_XXXX) - & gt; ShowWindow (SW_SHOW);
Hide and show the way, it is can solve the problem of data overlap, but if it is updated in real time data will be flashing ~
  • Related