[Newbie] A button with a bitmap
-
Hi all, I'm trying to set up a simple dialog with a button that has a bitmap instead of text. From the dialog editor I set the "Bitmap" option for the button and in the OnInitDialog() method of the dialog, I did the following: m_button.SetBitmap(LoadBitmap(NULL, MAKEINTRESOURCE(IDB_PLAY))); The button appears but no bitmap. Anyhelp would be GREATLY appreciated :-) Mark
-
Hi all, I'm trying to set up a simple dialog with a button that has a bitmap instead of text. From the dialog editor I set the "Bitmap" option for the button and in the OnInitDialog() method of the dialog, I did the following: m_button.SetBitmap(LoadBitmap(NULL, MAKEINTRESOURCE(IDB_PLAY))); The button appears but no bitmap. Anyhelp would be GREATLY appreciated :-) Mark
-
Hi all, I'm trying to set up a simple dialog with a button that has a bitmap instead of text. From the dialog editor I set the "Bitmap" option for the button and in the OnInitDialog() method of the dialog, I did the following: m_button.SetBitmap(LoadBitmap(NULL, MAKEINTRESOURCE(IDB_PLAY))); The button appears but no bitmap. Anyhelp would be GREATLY appreciated :-) Mark
Hi Mark seems like the loaded bitmap resource is set free when your leaving the OnInitDialog(). Therefor the bitmap not appear. Try this hint to avoid that : create a member var for the bitmap in your Dialog class : class CMyDialog : public CDialog { : : private : CBitmap m_Bmp; }; and in the OnInitDialog : BOOL CMyDialog::OnInitDialog() { CDialog::OnInitDialog(); m_Bmp.LoadBitmap ( IDB_PLAY ); m_button.SetBitmap( m_Bmp ); return TRUE; }
-
Hi all, I'm trying to set up a simple dialog with a button that has a bitmap instead of text. From the dialog editor I set the "Bitmap" option for the button and in the OnInitDialog() method of the dialog, I did the following: m_button.SetBitmap(LoadBitmap(NULL, MAKEINTRESOURCE(IDB_PLAY))); The button appears but no bitmap. Anyhelp would be GREATLY appreciated :-) Mark
-
Hi all, I'm trying to set up a simple dialog with a button that has a bitmap instead of text. From the dialog editor I set the "Bitmap" option for the button and in the OnInitDialog() method of the dialog, I did the following: m_button.SetBitmap(LoadBitmap(NULL, MAKEINTRESOURCE(IDB_PLAY))); The button appears but no bitmap. Anyhelp would be GREATLY appreciated :-) Mark
Which moron gave you one.
-
Which moron gave you one.
-
Some moron had rated your question as 1.