4

I need to add a clear button inside the CEdit control like this:

enter image description here

And I used CMFCEditBrowseCtrl, as described in this article: MFC Feature Pack - CMFCEditBrowseCtrl.

But the problem is that it shows a very small icon on monitors with high pixel density:

enter image description here

I tried to set a big icon, but the button remains narrow:

enter image description here

Could you please advice some solution?

ViH
  • 419
  • 2
  • 14
  • 1
    Get a lower resolution monitor, then you'll be fine! – Mark Ransom Jan 31 '22 at 18:16
  • I prefer high resolution monitors, and some other users of my app. – ViH Jan 31 '22 at 18:23
  • 1
    You would probably have to override the class and do some custom rendering. I have the same issue with my menu item bitmaps. They are all 16 x 16 and for UHD users the show really small. – Andrew Truckle Jan 31 '22 at 18:42
  • I was joking of course. The code you're using is obviously not DPI-aware, you'll need to fix that. – Mark Ransom Jan 31 '22 at 19:05
  • What would be the solution? Getting rid of the icon, replacing with another one or showing existing proportional to the size of the button? – JohnCz Feb 02 '22 at 13:59
  • JohnCz, I tried to set a big icon, but the button remains narrow (I've updated my post). – ViH Feb 02 '22 at 17:45
  • This should show that MFC is an evolutionary dead end, try using WinUI3 instead, it's a modern UI library that supports high DPI screens out of the box. – Blindy Feb 02 '22 at 17:46
  • Could you give some example of a user friendly and functional app on WinUI3? It seems to me that Microsoft continues the path of strange Windows 8 UIs. – ViH Feb 03 '22 at 18:44

0 Answers0