Button Bitmaps
-
Hi, i am trying to place a bitmap on a button but have had no success, i have read lots of ways of doing them and had a go at implementing them but i don't really understand about them. I was wondering if any one could explain it in simple terms maybe even give some sample code to make it easier to understand. Thanks Mav
-
Hi, i am trying to place a bitmap on a button but have had no success, i have read lots of ways of doing them and had a go at implementing them but i don't really understand about them. I was wondering if any one could explain it in simple terms maybe even give some sample code to make it easier to understand. Thanks Mav
Extremely simple if you are using VS6 with MFC:* Set the bitmap option of your button from the styles tab in the resource editor
-
Create a member variable of your button control using classwizard
-
In your OnInitDialog() or OnInitialUpdate() overridden function, set the bitmap of the button using the SetBitmap() member function. You will need to load your bitmap resource into a CBitmap variable for use by the button. So a sample code would look something like:
.. **_// m_bmpButtonImage is a CBitmap variable_** m_bmpButtonImage.LoadBitmap(IDB_IMAGE); **_// m_cButton is the associated control variable_** m_cButton.SetBitmap(m_bmpButtonImage); ..
I Dream of Absolute Zero
-
-
Hi, i am trying to place a bitmap on a button but have had no success, i have read lots of ways of doing them and had a go at implementing them but i don't really understand about them. I was wondering if any one could explain it in simple terms maybe even give some sample code to make it easier to understand. Thanks Mav
there is plenty of good articles on CP... ther's surely one for you : MFC Button Articles
TOXCCT >>> GEII power
-
Hi, i am trying to place a bitmap on a button but have had no success, i have read lots of ways of doing them and had a go at implementing them but i don't really understand about them. I was wondering if any one could explain it in simple terms maybe even give some sample code to make it easier to understand. Thanks Mav
-
Extremely simple if you are using VS6 with MFC:* Set the bitmap option of your button from the styles tab in the resource editor
-
Create a member variable of your button control using classwizard
-
In your OnInitDialog() or OnInitialUpdate() overridden function, set the bitmap of the button using the SetBitmap() member function. You will need to load your bitmap resource into a CBitmap variable for use by the button. So a sample code would look something like:
.. **_// m_bmpButtonImage is a CBitmap variable_** m_bmpButtonImage.LoadBitmap(IDB_IMAGE); **_// m_cButton is the associated control variable_** m_cButton.SetBitmap(m_bmpButtonImage); ..
I Dream of Absolute Zero
-