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

    Associating bitmap with Button

    I have followed a tuturial and done the following to associate a bitmap with button control. This is what has been called the automatic method.

    1. First set the button style owner drawn, its ID IDC_PLAY
    2. Then two bitmaps added with names PlayU and PlayD
    3. CBitmapButton btnVariable declared
    CBitmapButton btnVariable;


    4. Autoload memeber function is called in OnInitDialog()
    btnVariable.AutoLoad(IDC_PLAY, this);


    Now this is supposed to display the bitmaps but it gives exception in debugg mode and run normally in release mode but the button does not show up on the dialog!
    Can somebody advice, what is wrong with this procedure?
    thankx




  2. #2
    Join Date
    Aug 1999
    Posts
    17

    Re: Associating bitmap with Button

    Try putting "Play" as the button caption.


  3. #3
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: Associating bitmap with Button

    For an example of using CBitmapButton, check out my Example 12 at http://home.earthlink.net/~railro/mfc_link.html.

    Rail

    ------------
    Recording Engineer/Software Developer
    Rail Jon Rogut Software
    http://home.earthlink.net/~railro/
    [email protected]

  4. #4
    Join Date
    May 1999
    Posts
    388

    Re: Associating bitmap with Button

    I have already done this but it is not working. Can you give any other suggestion!



  5. #5
    Guest

    Re: Associating bitmap with Button

    The Autoload function subclasses the control and you are brobably using the
    DDX_Control function which also subclasses the button.
    instead of using Autoload, use :
    LoadBitmaps(...) and SizeToContent() functions with the DDX_Control.
    It works.



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