Click to See Complete Forum and Search --> : Text/background color
PUH
July 29th, 1999, 10:57 AM
Hi,
My control outputs text in a window.
If I change the backgroundcolor to, say, black,
and the textcolor to green, then the letters are
still on a white background.
Although the background without text is black.
How can I get green letters on a completely black background ?
Thanks,
PUH
Roger Allen
July 29th, 1999, 12:04 PM
In the MSDN documentation :
The background color for a character is specified by the SetBkColor and SetBkMode member functions of the CDC class.
This help ?
Roger Allen
Septimiu
July 30th, 1999, 03:23 AM
Hi,
you have to make the control transparent . If you are using an Edit control you have to implement the
OnCtlColor() function.
ccode
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
switch(nCtlColor)
{
case CTLCOLOR_EDIT:
{
pDC->SetBkMode(TRANSPARENT);
return myNewBrush;
}
}
return myOldBrush;
}
//where myNewBrush is a brush made with your desired color
//and myOldBrush is a grey one.
/ccode
krba
August 3rd, 1999, 02:46 PM
in *.cpp not *Dlg.cpp put SetDialogBkColor...
-------------------------------------------------
BOOL COcdApp::InitInstance()
{
AfxEnableControlContainer();
//*************THIS**************************
SetDialogBkColor(RGB(0, 0, 0), RGB(0, 0, 255));
//*******************************************
// Standard initialization
// If you are not using these features and wi...
krba
August 3rd, 1999, 03:03 PM
No, Roger, not enough :)
Well, I put static text. Colored (green fonts on black). For background, I load bitmap picture on way: ClassWizard->InsertActiveX Control..->choose Microsoft Forms 2.0 Image -> this creates frame, then go to properties->All->choose picture and in right cell click mice->find the *.bmp picture in directory ... and this is it. Stuffs works great.
(Thanx M$).
And now, how to make my static text transparent, without black background?
I find some "tetris" whatever example, some hints (which are far away from "hinting" me...) So, who would be so kind, and dummy me tell how to make this letters transparent, without background?
Thanx.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.