CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    198

    MFCButton control images and differing screen resolutions

    Hey Gurus!

    I have an application where I use CMFCButton controls. Using SetImage() I have put an icon to the left of the text in the button.

    It looks great and works well.

    Recently I installed my application onto a laptop with a different screen resolution, and consequently all the images next to the text in the buttons are now displayed smaller than I was expecting. I also have the same issue that uses an icon in a picture control.

    It makes sense of course, differing screen resolutions with set width and height icons are not going to display the same on each screen.

    Is there something in the API to allow for this type of issue, and if not, how do I go about doing it manually?

    Thanks so much in advance.

    Steve Q. :-)

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: MFCButton control images and differing screen resolutions

    Quote Originally Posted by steveq View Post
    ... how do I go about doing it manually?
    You could try to override the CMFCButton::DrawItem method. Note, however, that the button has to have BS_OWNERDRAW style.
    Last edited by VictorN; April 29th, 2017 at 03:19 AM.
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    198

    Re: MFCButton control images and differing screen resolutions

    Thanks Victor,

    I'll have a look and see if I can implement something myself.

    Steve Q :-)

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