Using CBitmapButton 
Author Message
 Using CBitmapButton

I want to create a BitmapButton in a dialog but I faced some difficulties.
I'm not using MFC in my application. I've read the help file in eVC. It
suggests me to do the followings:
But I don't understand how should I like my bitmap images to the program.
Should I add them to resources?
Since I don't have CDialog class, and I'm using the Dialog handler, how can
I create/derive the CBitmapButton object? What should I do for the later
steps?
Can anyone give me some example?
Thankyou!!

1. Create one to four bitmap images for the button.
2. Create a dialog template with an owner-draw button positioned where you
want the bitmap button. The size of the button in the template does not
matter.
3. Set the button caption to a value such as MYIMAGE and define a symbol for
the button such as IDC_MYIMAGE.
4. In your application resource script, give each image created for the
button an identifier constructed by appending a letter U, D, F, or X?Xfor
up, down, focused, and disabled?Xto the string used for the button caption
in step 3. For the button caption MYIMAGE, for example, the identifiers
would be "MYIMAGEU", "MYIMAGED", "MYIMAGEF", and "MYIMAGEX". You must
specify the identifier of your bitmap within double quotes. Otherwise the
resource editor assigns an integer to the resource, and MFC fails when
loading the image.
5. In your application?|s dialog class, derived from CDialog, add a
CBitmapButton member object.
6. In the OnInitDialog routine of the CDialog object, call the AutoLoad
function of the CBitmapButton object, using as parameters the control
identifier of the button and the CDialog object, this pointer.



Mon, 19 Sep 2005 15:33:10 GMT  
 Using CBitmapButton

If you are not using MFC in your app you will not be able to use
CBitmapButton class (which is part of MFC).

You have to create an owner-drawn button and draw icons on it manually.

--
Sincerely,
Alexander


http://www.RSDN.ru - Russian Software Developer Network


Quote:
> I want to create a BitmapButton in a dialog but I faced some difficulties.
> I'm not using MFC in my application. I've read the help file in eVC. It
> suggests me to do the followings:
> But I don't understand how should I like my bitmap images to the program.
> Should I add them to resources?
> Since I don't have CDialog class, and I'm using the Dialog handler, how
can
> I create/derive the CBitmapButton object? What should I do for the later
> steps?
> Can anyone give me some example?
> Thankyou!!

> 1. Create one to four bitmap images for the button.
> 2. Create a dialog template with an owner-draw button positioned where you
> want the bitmap button. The size of the button in the template does not
> matter.
> 3. Set the button caption to a value such as MYIMAGE and define a symbol
for
> the button such as IDC_MYIMAGE.
> 4. In your application resource script, give each image created for the
> button an identifier constructed by appending a letter U, D, F, or X?Xfor
> up, down, focused, and disabled?Xto the string used for the button caption
> in step 3. For the button caption MYIMAGE, for example, the identifiers
> would be "MYIMAGEU", "MYIMAGED", "MYIMAGEF", and "MYIMAGEX". You must
> specify the identifier of your bitmap within double quotes. Otherwise the
> resource editor assigns an integer to the resource, and MFC fails when
> loading the image.
> 5. In your application?|s dialog class, derived from CDialog, add a
> CBitmapButton member object.
> 6. In the OnInitDialog routine of the CDialog object, call the AutoLoad
> function of the CBitmapButton object, using as parameters the control
> identifier of the button and the CDialog object, this pointer.



Mon, 19 Sep 2005 15:59:38 GMT  
 Using CBitmapButton
ic~
Thx!



Quote:

> If you are not using MFC in your app you will not be able to use
> CBitmapButton class (which is part of MFC).

> You have to create an owner-drawn button and draw icons on it manually.

> --
> Sincerely,
> Alexander


> http://www.RSDN.ru - Russian Software Developer Network



> > I want to create a BitmapButton in a dialog but I faced some
difficulties.
> > I'm not using MFC in my application. I've read the help file in eVC. It
> > suggests me to do the followings:
> > But I don't understand how should I like my bitmap images to the
program.
> > Should I add them to resources?
> > Since I don't have CDialog class, and I'm using the Dialog handler, how
> can
> > I create/derive the CBitmapButton object? What should I do for the later
> > steps?
> > Can anyone give me some example?
> > Thankyou!!

> > 1. Create one to four bitmap images for the button.
> > 2. Create a dialog template with an owner-draw button positioned where
you
> > want the bitmap button. The size of the button in the template does not
> > matter.
> > 3. Set the button caption to a value such as MYIMAGE and define a symbol
> for
> > the button such as IDC_MYIMAGE.
> > 4. In your application resource script, give each image created for the
> > button an identifier constructed by appending a letter U, D, F, or
X?Xfor
> > up, down, focused, and disabled?Xto the string used for the button
caption
> > in step 3. For the button caption MYIMAGE, for example, the identifiers
> > would be "MYIMAGEU", "MYIMAGED", "MYIMAGEF", and "MYIMAGEX". You must
> > specify the identifier of your bitmap within double quotes. Otherwise
the
> > resource editor assigns an integer to the resource, and MFC fails when
> > loading the image.
> > 5. In your application?|s dialog class, derived from CDialog, add a
> > CBitmapButton member object.
> > 6. In the OnInitDialog routine of the CDialog object, call the AutoLoad
> > function of the CBitmapButton object, using as parameters the control
> > identifier of the button and the CDialog object, this pointer.



Mon, 19 Sep 2005 21:20:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem of using CBitmapButton 3!!!

2. Problem of using CBitmapButton 2!!!

3. Problem of using CBitmapButton!!!

4. Using MFC CBitmapButton in ATL CDialogImpl Fails

5. CBitmapButton Proposed Change

6. WTL: How to use CBitmapButton

7. Sparky CBitmapButton question ...

8. CBitmapButton::LoadBitmaps() not working ...strange ...

9. Help with CBitmapButton

10. Assertion with CBitmapButton!!!

11. Crashes in CBitmapButton::DrawItem

12. Problem Creating CBitmapButton

 

 
Powered by phpBB® Forum Software