Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Where have the wizards gone, ActiveX Controls Pin
greekgoddj22-Dec-04 5:03
greekgoddj22-Dec-04 5:03 
GeneralRe: Where have the wizards gone, ActiveX Controls Pin
Antti Keskinen22-Dec-04 5:46
Antti Keskinen22-Dec-04 5:46 
GeneralVisual C++ read autocad(dxf) Pin
yangxjn21-Dec-04 3:49
yangxjn21-Dec-04 3:49 
GeneralRe: Visual C++ read autocad(dxf) Pin
David Crow21-Dec-04 4:44
David Crow21-Dec-04 4:44 
Questionserial port buffer full? Pin
Nik0n20-Dec-04 23:56
Nik0n20-Dec-04 23:56 
AnswerRe: serial port buffer full? Pin
Trollslayer21-Dec-04 2:06
mentorTrollslayer21-Dec-04 2:06 
GeneralRe: serial port buffer full? Pin
Nik0n21-Dec-04 2:25
Nik0n21-Dec-04 2:25 
QuestionTransparent Label ? Pin
pc_dev20-Dec-04 23:13
pc_dev20-Dec-04 23:13 
Thanks in advance.

I want to display a transparent label on a dialog; where as a bitmap is set as the dialogs background.

The problem is that if the text in label is not changing its fine, but if the numbers in label are changed they overwrite the previous one creating black squares at each charchter position.

Here is how i set the image as back ground of dialog;

void MyDlg::OnPaint()
{
CPaintDC dc( this ); // Device context for painting

CBitmap bmp, *poldbmp;
CDC memdc;

bmp.LoadBitmap( IDB_BITMAP13 );
memdc.CreateCompatibleDC( &dc );
poldbmp = memdc.SelectObject( &bmp );
dc.BitBlt( 0, 31, 1009, 521, &memdc, 0, 0, SRCCOPY );
memdc.SelectObject( poldbmp );

// Do not call CDialog::OnPaint() for painting messages
}

The problem remains same if OnEraseBkgnd function is used for background image;

And here is how I display a Transparent Label:

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

if(pWnd->GetDlgCtrlID() == IDC_L1) // IDC_L1 is label ID
{
pDC->SetBkMode(TRANSPARENT);
hbr = (HBRUSH)::GetStockObject(NULL_BRUSH);
}

return hbr;
}

static labels are absolutely fine but the changing ones mess up.
GeneralUpload picture Pin
henryzal20-Dec-04 22:25
susshenryzal20-Dec-04 22:25 
GeneralRe: webservice Pin
Antti Keskinen20-Dec-04 22:17
Antti Keskinen20-Dec-04 22:17 
GeneralDynamic Crystal report viewer control Pin
Rahim Rattani20-Dec-04 20:40
Rahim Rattani20-Dec-04 20:40 
GeneralRe: Dynamic Crystal report viewer control Pin
naren-vc21-Dec-04 21:57
naren-vc21-Dec-04 21:57 
Generalset cprintdialog.m_pd.hdevmode Pin
nancysangeetha20-Dec-04 20:20
nancysangeetha20-Dec-04 20:20 
GeneralRe: set cprintdialog.m_pd.hdevmode Pin
David Crow21-Dec-04 2:17
David Crow21-Dec-04 2:17 
GeneralRe: set cprintdialog.m_pd.hdevmode Pin
nancysangeetha21-Dec-04 17:54
nancysangeetha21-Dec-04 17:54 
GeneralCalling a web service form MFC... Pin
anderslundsgard20-Dec-04 20:06
anderslundsgard20-Dec-04 20:06 
GeneralRe: Calling a web service form MFC... Pin
Antti Keskinen20-Dec-04 22:19
Antti Keskinen20-Dec-04 22:19 
GeneralRe: Calling a web service form MFC... Pin
anderslundsgard20-Dec-04 23:42
anderslundsgard20-Dec-04 23:42 
GeneralRe: Calling a web service form MFC... Pin
Antti Keskinen21-Dec-04 4:45
Antti Keskinen21-Dec-04 4:45 
GeneralConvert CString to Integer Pin
Anonymous20-Dec-04 19:46
Anonymous20-Dec-04 19:46 
GeneralRe: Convert CString to Integer Pin
SivaramanDhamodharan20-Dec-04 19:58
SivaramanDhamodharan20-Dec-04 19:58 
GeneralRe: Convert CString to Integer Pin
Jon Hulatt20-Dec-04 21:56
Jon Hulatt20-Dec-04 21:56 
GeneralRe: Convert CString to Integer Pin
David Crow21-Dec-04 2:01
David Crow21-Dec-04 2:01 
GeneralRe: Convert CString to Integer Pin
Jon Hulatt21-Dec-04 5:19
Jon Hulatt21-Dec-04 5:19 
GeneralRe: Convert CString to Integer Pin
Renjith Ramachandran20-Dec-04 20:37
Renjith Ramachandran20-Dec-04 20:37 

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.