如何在单击对话框中的按钮(DialogBox1)后打开的新对话框(DialogBox2)中将图像设置为按钮
案例WM_INITDIALOG:
hA1 = GetDlgItem(hDlg, IDD_SCORPIO);
hbitmap=LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IMG_BITMAPAries),IMAGE_BITMAP,0, 0, LR_DEFAULTCOLOR);
if(hbitmap==NULL)
MessageBox(hDlg,"load fail","Load",MB_OK);
else
MessageBox(hDlg,"load pass","Load",MB_OK);
if(SendMessage(hA1,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)hbitmap))
MessageBox(hDlg,"set pass","Set Image",MB_OK);
else
MessageBox(hDlg,"set fail","Set Image",MB_OK);
位图加载但我无法设置图像。
答案 0 :(得分:0)
为您的按钮设置 BS_BITMAP 样式。