I am migrating an Excel VBA Add-In to a VSTO Add-In written in C#. The user interface will include a custom ribbon tab with custom button images and five or so user forms. With the VBA version, I ignored DPI awareness without any issues.
After a lot of research, I've concluded that making the VSTO Add-In's DPI awareness fully automated across multiple display systems is a complicated task that may not yield 100% reliable results. Instead, I've written code (that the user can override) to retrieve Screen Class properties that allow my Add-In to detect the screen resolutions of all connected displays, determine the display where Excel starts, and make an educated guess regarding the optimum button image and user form sizes for that display.
I realize my approach may not be the most advanced, but it's uncomplicated and it works. Have I missed a 100% consistent way to detect the true display scaling of multiple monitors, or does my approach sound like it's a good compromise between reliability, simplicity, and user experience?
Many thanks for any opinions or experiences that can be shared!