Click here to Skip to main content
15,918,516 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWindows Error Message Pin
.NetRams29-Sep-05 19:50
.NetRams29-Sep-05 19:50 
AnswerRe: Windows Error Message Pin
Mircea Puiu30-Sep-05 21:23
Mircea Puiu30-Sep-05 21:23 
QuestionCAsyncSocket vs CAsyncSocketEx Pin
Suraihan29-Sep-05 19:38
Suraihan29-Sep-05 19:38 
QuestionBitmap Dialog. Pin
rajeev8229-Sep-05 19:10
rajeev8229-Sep-05 19:10 
AnswerRe: Bitmap Dialog. Pin
ThatsAlok29-Sep-05 19:26
ThatsAlok29-Sep-05 19:26 
GeneralRe: Bitmap Dialog. Pin
vikas amin29-Sep-05 19:50
vikas amin29-Sep-05 19:50 
GeneralRe: Bitmap Dialog. Pin
ThatsAlok29-Sep-05 20:12
ThatsAlok29-Sep-05 20:12 
GeneralRe: Bitmap Dialog. Pin
vikas amin29-Sep-05 22:55
vikas amin29-Sep-05 22:55 
I think ur problem is to Set Transperent the Backgroudn colour of the CStatic ??
Ok
Add this message handler to your code WM_CTLCOLOR
By the Controls Resource ID get the
pointer to that control's window "IDC_STATIC" is the static text on my dialog box
and then send
pDC->SetBkMode(TRANSPARENT);
message to the control

I am sending u the code from my dialobbox(LoginBox) for the OnCtlColor event :-


HBRUSH LoginBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

CBrush m_brush;
m_brush.CreateSolidBrush (RGB(45, 55, 0));

// TODO: Change any attributes of the DC here

if (pWnd->GetDlgCtrlID() == IDC_STATIC)
{
// Set the text color to red
pDC->SetTextColor(RGB(200, 200, 200));
pDC->SetBkColor(RGB(45, 55, 0)); //THIS DONT WORK

// Set the background mode for text to transparent
// so background will show thru.
pDC->SetBkMode(TRANSPARENT);

hbr = (HBRUSH)GetStockObject( NULL_BRUSH );// if u dont set this then the label will not be trasparent

// Return handle to our CBrush object
//hbr = m_brush; //here the m_brush is the initialized and created CBrush member named m_brush of the dialog box it is need for the backgroud painting so i have disabled it
}
// TODO: Return a different brush if the default is not desired
return hbr;
}


hope so this clears ur query

Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
AnswerRe: Bitmap Dialog. Pin
vikas amin29-Sep-05 20:49
vikas amin29-Sep-05 20:49 
QuestionDisplaying Text in System Tray Pin
hairam29-Sep-05 19:01
hairam29-Sep-05 19:01 
AnswerRe: Displaying Text in System Tray Pin
douglasjordan30-Sep-05 4:47
douglasjordan30-Sep-05 4:47 
GeneralRe: Displaying Text in System Tray Pin
hairam1-Oct-05 6:32
hairam1-Oct-05 6:32 
GeneralRe: Displaying Text in System Tray Pin
douglasjordan1-Oct-05 8:12
douglasjordan1-Oct-05 8:12 
Questionrecursive function to search folder contents Pin
dharani29-Sep-05 18:32
dharani29-Sep-05 18:32 
AnswerRe: recursive function to search folder contents Pin
ThatsAlok29-Sep-05 18:59
ThatsAlok29-Sep-05 18:59 
AnswerRe: recursive function to search folder contents Pin
benjnp30-Sep-05 6:42
benjnp30-Sep-05 6:42 
QuestionWM_COPYDATA Pin
Nishad S29-Sep-05 18:24
Nishad S29-Sep-05 18:24 
AnswerRe: WM_COPYDATA Pin
ThatsAlok29-Sep-05 22:12
ThatsAlok29-Sep-05 22:12 
AnswerRe: WM_COPYDATA Pin
douglasjordan30-Sep-05 11:16
douglasjordan30-Sep-05 11:16 
QuestionHelp !!! Cannot install Visual Studio 6 Pin
erajsri29-Sep-05 17:53
erajsri29-Sep-05 17:53 
QuestionEncoding Pin
Member 216100429-Sep-05 17:17
Member 216100429-Sep-05 17:17 
QuestionAccess 97 Pin
AHawk29-Sep-05 16:40
AHawk29-Sep-05 16:40 
QuestionConversion between Hex and Character Pin
Member 78215429-Sep-05 14:51
Member 78215429-Sep-05 14:51 
QuestionRuntime for Accessing Jet files Pin
Joe Woodbury29-Sep-05 11:52
professionalJoe Woodbury29-Sep-05 11:52 
AnswerRe: Runtime for Accessing Jet files Pin
Graham Bradshaw29-Sep-05 13:46
Graham Bradshaw29-Sep-05 13:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.