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

C / C++ / MFC

 
GeneralRe: Constructor & Destructor Pin
jbarton28-Mar-03 7:36
jbarton28-Mar-03 7:36 
GeneralBuild like Visual Studio Pin
calgonit28-Mar-03 5:48
calgonit28-Mar-03 5:48 
GeneralOutlook Automation :-( ( attachment) Pin
Braulio Dez28-Mar-03 5:28
Braulio Dez28-Mar-03 5:28 
GeneralSolution... sh*tty automation Pin
Braulio Dez28-Mar-03 5:47
Braulio Dez28-Mar-03 5:47 
Generaldialog editor question (fine tuning the position of one control) Pin
Joan M28-Mar-03 5:21
professionalJoan M28-Mar-03 5:21 
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Big Art28-Mar-03 5:33
Big Art28-Mar-03 5:33 
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Joan M28-Mar-03 5:39
professionalJoan M28-Mar-03 5:39 
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Big Art28-Mar-03 5:57
Big Art28-Mar-03 5:57 
I would avoid the picture control method of putting the bitmap on the dialog background.

Do this instead:
//Declare some variables:

CBrush m_brush;
CBitmapButton m_btnOK;
CBitmapButton m_btnCancel;

//Add code:
OnInitDialog:
{
...

RECT rc;
GetClientRect(&rc);
HBITMAP hBmp=NULL;
hBmp=(HBITMAP)::LoadImage(NULL,"YourPath.bmp",IMAGE_BITMAP,rc.right,rc.bottom,LR_LOADFROMFILE);
CBitmap *pBmp=CBitmap::FromHandle(hBmp);
m_brush.CreatePatternBrush(pBmp);
::DeleteObject(hBmp);



// Load Graphics onto OwnerDrawn buttons.
// These are CBitmapButton objects
m_btnOK.AutoLoad(IDOK,this);
m_btnCancel.AutoLoad(IDCANCEL,this);

}


OnPaint()
{
//Paint the background with the image brush
CRect rcClient;
GetClientRect(&rcClient);
dc.FillRect(&rcClient,&m_brush);

}

OnCtlColor(..)
{

HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

switch(nCtlColor)
{
case CTLCOLOR_STATIC:
pDC->SetTextColor(RGB(TBD));

case CTLCOLOR_BTN:
pDC->SetBkMode(TRANSPARENT);

case CTLCOLOR_DLG:
hbr=m_brush;


}
return hbr;
}

Art
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Joan M28-Mar-03 6:15
professionalJoan M28-Mar-03 6:15 
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Big Art28-Mar-03 6:51
Big Art28-Mar-03 6:51 
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Joan M28-Mar-03 7:05
professionalJoan M28-Mar-03 7:05 
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Big Art28-Mar-03 7:19
Big Art28-Mar-03 7:19 
GeneralRe: dialog editor question (fine tuning the position of one control) Pin
Joan M28-Mar-03 7:27
professionalJoan M28-Mar-03 7:27 
GeneralMutual exclusion Pin
act_x28-Mar-03 5:20
act_x28-Mar-03 5:20 
GeneralRe: Mutual exclusion Pin
Neville Franks28-Mar-03 10:08
Neville Franks28-Mar-03 10:08 
GeneralWindows Registry blues Pin
fd975028-Mar-03 5:02
professionalfd975028-Mar-03 5:02 
GeneralRe: Windows Registry blues Pin
Chris Losinger28-Mar-03 5:20
professionalChris Losinger28-Mar-03 5:20 
GeneralRe: Windows Registry blues Pin
Big Art28-Mar-03 5:22
Big Art28-Mar-03 5:22 
GeneralRe: Windows Registry blues Pin
fd975030-Mar-03 20:07
professionalfd975030-Mar-03 20:07 
QuestionHowto configure doxygen ? Pin
yarp28-Mar-03 5:00
yarp28-Mar-03 5:00 
AnswerRe: Howto configure doxygen ? Pin
Andreas Saurwein28-Mar-03 5:05
Andreas Saurwein28-Mar-03 5:05 
GeneralRe: Howto configure doxygen ? Pin
yarp28-Mar-03 7:10
yarp28-Mar-03 7:10 
Questionhow to add a bitmap.. Pin
liquidsnake18328-Mar-03 4:50
liquidsnake18328-Mar-03 4:50 
AnswerRe: how to add a bitmap.. Pin
Joan M28-Mar-03 5:42
professionalJoan M28-Mar-03 5:42 
Questionoutput iterators? Pin
Andreas Saurwein28-Mar-03 4:44
Andreas Saurwein28-Mar-03 4:44 

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.