0

In this there is one static control text in blue background and edit box has text. Now I want to transparent the background of edit box. I am new in mfc vc++. I am trying to transparent the background of edit box.but till now I am not getting expected result.

enter image description here

if ( pWnd->GetDlgCtrlID() == IDC_editbox)//
{
    pDC->SetTextColor(RGB(255, 255, 0));
pDC->SetBkColor(TRANSPARENT);
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)::GetStockObject(NULL_BRUSH);
 }
Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
Lata
  • 11
  • 5
  • I'm pretty sure you can't do this, but anyway: why would you want a transparent edit control?? – Jabberwocky Mar 15 '19 at 09:59
  • Hello, there is another static control is behind this in green color background.So I just want to display only text on screen not its background – Lata Mar 15 '19 at 10:01
  • Maybe you should [edit] your question and add a picture of what you want vs what you get. – Jabberwocky Mar 15 '19 at 10:02
  • 1
    Don't try to make your edit control transparent, but rather change it's background color as explained here: https://stackoverflow.com/questions/218035/mfc-changing-the-colour-of-cedit – Jabberwocky Mar 15 '19 at 10:10
  • @Jabberwocky: I have added the image .Please help if you can.I am just got stuck in this issue from last few weeks. – Lata Mar 15 '19 at 10:10
  • In the link you suggested what is the color assigned to " m_brMyEditBk " – Lata Mar 15 '19 at 10:18
  • It should obviously be the same color as your blue background. That's up to you. – Jabberwocky Mar 15 '19 at 10:19
  • @Jabberwocky : Sir it dosen't solve my problem .because at last I have to play a video in static control window.So If I change it to particular color the problems will remains the same. – Lata Mar 15 '19 at 10:21
  • Consider this answer: https://stackoverflow.com/a/16296246/898348. – Jabberwocky Mar 15 '19 at 10:22
  • OK, different story. You probably can't do it.. But from the UI perspective a transparent edit control over a video doesn't sound like a good idea to me. – Jabberwocky Mar 15 '19 at 10:23
  • ok.thank you for your time – Lata Mar 15 '19 at 10:24

0 Answers0