C
Danke Evil
Funktioniert super dein code..
Ich wollte die schrifft größe ändern wenn ich das tue dann ist der Text nicht mehr Transparent.
Habe eine funktion für schrifft größe geschrieben die von OnInitDialog() aufgerufen wird.
void CBmpFond2Dlg:: FondInit()
{
////// f.k Fonds
CFont myFont;
int nHeight=26;
int nWidth=9;
int nWeight=10;
bool bUnderline=false;
bool bItalic=true;
bool bStrikeOut=false;
myFont.CreateFont(nHeight,nWidth,0,0,nWeight,bItalic,bUnderline,bStrikeOut,0,0,0,0,0,"Comic Sans MS");
GetDlgItem(IDC_ANZEIGE1)->SetFont(&myFont);
sFey="Hallo";//global
m_sStatic1=sFey;
UpdateData(false);
}
In OnCtlColor
HBRUSH CBmpFond2Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// TODO: Ändern Sie hier alle Attribute für den DC.
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID()==IDC_ANZEIGE1)
{
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
return hbr;
}
was mache ich hier falsch..?
wenn ich das ganze in ein Button Funktion Aufrufe dann geht es
void CBmpFond2Dlg::OnBnClickedButton1()
{
// TODO: Fügen Sie hier Ihren Kontrollbehandlungscode für die Benachrichtigung ein.
////// f.k Fonds
CFont myFont;
int nHeight=26;
int nWidth=9;
int nWeight=10;
bool bUnderline=false;
bool bItalic=true;
bool bStrikeOut=false;
myFont.CreateFont(nHeight,nWidth,0,0,nWeight,bItalic,bUnderline,bStrikeOut,0,0,0,0,0,"Comic Sans MS");
GetDlgItem(IDC_ANZEIGE1)->SetFont(&myFont);
sFey="Hallo";
m_sStatic1=sFey;
UpdateData(false);
}