CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    Icon on a Button

    Is there an easy way to show an icon on top of a button?

    I have a set of 16x16 icons. I'd like to chose one and display it on top of a button.

    I tried using OwnerDraw. Is that the best approach? If so, how do I draw the standard buttons Up/Down/Focus/Disabled?




  2. #2
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: Icon on a Button

    There are two fairly easy options - CToolBar and CToolBarCtrl can handle
    this stuff with their default methods and I think it sizes the button to the image.
    There are classes on this site that demonstrate using them with high-color images
    also. Another option is to use CBitmapButton. I think it sizes the button to the
    image size also. It takes one image for each of the four states. See the VC
    sample called CtrlTest for an illustration of this.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured