Question : how to paste a bitmap on a button

I am trying to paste a bitmap on a button
right now I am using this code in OnInitDialog()
CButton *dlgButton = (CButton*)GetDlgItem(IDC_START);
      CBitmap key;
      key.LoadBitmap(IDB_BITMAP1);
        dlgButton->SetBitmap((HBITMAP)key);
But, on execution, no bitmap is displayed on the button, just all white...
what could be worng.
:(

Answer : how to paste a bitmap on a button

make the CBitmap key   as memeber variable of your dialog box.
Because you have defined it as local variable thats way its not getting displayed.
Random Solutions  
 
programming4us programming4us