Click here to Skip to main content
16,006,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: display a image on button [modified] Pin
Hamid_RT29-Jun-06 1:45
Hamid_RT29-Jun-06 1:45 
GeneralRe: display a image on button Pin
Amit Agarrwal29-Jun-06 1:54
Amit Agarrwal29-Jun-06 1:54 
GeneralRe: display a image on button Pin
Hamid_RT29-Jun-06 2:00
Hamid_RT29-Jun-06 2:00 
GeneralRe: display a image on button Pin
ovidiucucu29-Jun-06 2:09
ovidiucucu29-Jun-06 2:09 
GeneralRe: display a image on button Pin
Amit Agarrwal29-Jun-06 2:11
Amit Agarrwal29-Jun-06 2:11 
GeneralRe: display a image on button Pin
ovidiucucu29-Jun-06 2:11
ovidiucucu29-Jun-06 2:11 
GeneralRe: display a image on button Pin
Amit Agarrwal29-Jun-06 3:02
Amit Agarrwal29-Jun-06 3:02 
GeneralRe: display a image on button Pin
Amit Agarrwal29-Jun-06 20:44
Amit Agarrwal29-Jun-06 20:44 
hi
it was working with single image but

i want to display two different images in two different buttons.

when i use the code it always showing the same image in both of the buton while the images are different..


i have used follwing code in Oninidialog()

<br />
<br />
LoadButtonBitmapImage(IDC_BUTTON2, _T("D:\\Swaraj Sir PC Data\\SwPhone\\SwPhone\\TeletikPhone\\images\\1.bmp"));<br />
<br />
LoadButtonBitmapImage(IDC_BUTTON3, _T("D:\\Swaraj Sir PC Data\\SwPhone\\SwPhone\\TeletikPhone\\images\\2.bmp"));<br />


and following code use the function;

void  sipxmngr::LoadButtonBitmapImage(UINT nButtonResID,LPCTSTR pszBitmapFile)<br />
{ <br />
	//-----------------------------------------------------------<br />
	<br />
	CButton* pButton = (CButton*)GetDlgItem(IDC_BUTTON2);  // be sure the button has BS_BITMAP style   <br />
	<br />
	pButton->ModifyStyle(BS_ICON, BS_BITMAP); <br />
	<br />
	// load bitmap from file <br />
	<br />
	HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL,pszBitmapFile,IMAGE_BITMAP, 0, 0,LR_DEFAULTCOLOR|LR_LOADFROMFILE);   <br />
    <br />
	// set the button bitmap   <br />
	<br />
	pButton->SetBitmap(hBitmap);<br />
   //------------------------------------------------------------------<br />
<br />
CButton* pButton1 = (CButton*)GetDlgItem(IDC_BUTTON3);   // be sure the button has BS_BITMAP style   <br />
	<br />
	pButton1->ModifyStyle(BS_ICON, BS_BITMAP); <br />
	// load bitmap from file <br />
	<br />
	HBITMAP hBitmap1 = (HBITMAP)::LoadImage(NULL,pszBitmapFile,IMAGE_BITMAP, 0, 0,LR_DEFAULTCOLOR|LR_LOADFROMFILE);   <br />
    // set the button bitmap   <br />
	//<br />
	pButton1->SetBitmap(hBitmap1);<br />
<br />
}


it always show me the same image where i'm making mistake..plz tell me

thanx
GeneralRe: display a image on button Pin
Amit Agarrwal29-Jun-06 21:11
Amit Agarrwal29-Jun-06 21:11 
AnswerRe: display a image on button Pin
David Crow29-Jun-06 2:57
David Crow29-Jun-06 2:57 
QuestionActiveX issue Pin
Nader Elshehabi28-Jun-06 23:41
Nader Elshehabi28-Jun-06 23:41 
AnswerRe: ActiveX issue Pin
bob1697229-Jun-06 1:59
bob1697229-Jun-06 1:59 
GeneralRe: ActiveX issue Pin
Nader Elshehabi29-Jun-06 3:24
Nader Elshehabi29-Jun-06 3:24 
GeneralRe: ActiveX issue Pin
bob1697229-Jun-06 4:32
bob1697229-Jun-06 4:32 
GeneralRe: ActiveX issue Pin
Nader Elshehabi29-Jun-06 5:13
Nader Elshehabi29-Jun-06 5:13 
Questiontwo calsses Pin
ashish dogra28-Jun-06 23:28
ashish dogra28-Jun-06 23:28 
AnswerRe: two calsses Pin
Cedric Moonen28-Jun-06 23:32
Cedric Moonen28-Jun-06 23:32 
GeneralRe: two calsses Pin
ashish dogra28-Jun-06 23:53
ashish dogra28-Jun-06 23:53 
GeneralRe: two calsses Pin
Cedric Moonen28-Jun-06 23:56
Cedric Moonen28-Jun-06 23:56 
GeneralRe: two calsses Pin
ashish dogra29-Jun-06 0:03
ashish dogra29-Jun-06 0:03 
GeneralRe: two calsses Pin
Cedric Moonen29-Jun-06 0:07
Cedric Moonen29-Jun-06 0:07 
AnswerRe: two calsses Pin
David Crow29-Jun-06 3:04
David Crow29-Jun-06 3:04 
QuestionWindows Hooks [modified] Pin
capricious_00128-Jun-06 22:53
capricious_00128-Jun-06 22:53 
AnswerRe: Windows Hooks Pin
Naveen28-Jun-06 23:34
Naveen28-Jun-06 23:34 
GeneralRe: Windows Hooks Pin
capricious_00129-Jun-06 0:16
capricious_00129-Jun-06 0:16 

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.