I want to make my C# application DPI aware. There is a command available in Windows API called SetProcessDPIAware() but the problem is it only works in Windows Vista and higher versions of Windows and not in XP. How can I make the controls, Buttons and Fonts DPI aware such that it displays correctly regardless what ever Windows version is used?
DPI Aware application in Windows XP
4k views Asked by zeeshan malik At
2
There are 2 answers
0
Ian Boyd
On
See my moderately detailed answer on how to make an application respond to DPI settings on this StackOverflow question.
The short version is that you can change all your form's AutoScaleMode to ScaleMode.Dpi.
But it's better to leave it at ScaleMode.Font; fonts get bigger as the DPI increases.
Related Questions in WINDOWS-XP
- Considering Proxmox to replace individual legacy PCs and LAN servers
- playback of sound written in Assembly by external speakers
- Why is my Application not running on Windows XP
- Connecting a SQL Server Express 2008 R2 database to Visual Studio 2017 without upgrading it
- Old Windows XP EXE program can“t run on Windows server 2019 standard
- Run-time error '6': Overflow after installing Visual Basic 5.0 application on Windows XP
- how to build Golang for windows xp in Ubuntu?
- Does or DID Win32 CopyFile(W) ever raise a (SEH) exception?
- C++ 'default argument': cannot convert from 'const wchar_t' to 'BSTR'
- PySimpleGUI Attribute Error on Windows XP SP3 with Python 3.4.4
- Printf or MessageBox in ASM for debugging
- gSoap MinGW compilation error _set_errno was not declared in this scope
- .NET 4.0 compiled application attempts to load .NET 4.8 framework
- ComCtl32.dll Ordinal 345 not found error only on Windows XP
- Is it possible to cross-compile C++ applications from Linux for Windows XP?
Related Questions in DPI
- How to Enable USB Debugging from ADB or Recovery (Mobile Not bootable)?
- Get Screen Display Size (Diagonal) in Inches
- Trying to programmatically set DPI for second screen on my Android device
- Problem with CSS on same resolution (1080p) but different displays (external monitor, laptop display) and zoom level
- C# draw in PictureBox "removes DPI scale"
- High DP scaling override winforms
- Win Api DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 - WM_GETDPISCALEDSIZE msg is not sent
- Meaning of PPI (Pixel Per Inch)
- How to get dpi of an image cropped with Python? Tesseract --dpi parameter
- Scaling issues, not sure where to begin
- Why isnt the dpi argument increasing resolution in matplotlib?
- Anaconda Navigator start widow can't resize or minimise
- Why are histograms incorrectly displayed when the distribution is tightly clustered?
- WPF Incorrect Window Size On Scaled Operating System DPI (DPI-Aware/DPI-Unaware)
- Graphics.DrawString doesn't print a text
Related Questions in DPI-AWARE
- DPI Aware application in Windows XP
- Unable to make app DPI aware - this is not a duplicate
- Handling change of primary DPI without restarting the app
- DpiAware in service application
- Winforms application throws Win32Exception if marked as DPI aware and used with multiple monitors
- Problems with per-monitor DPI aware MFC MDI app
- How to use my own manifest file and embed it into executable using Visual Studio 2017?
- Make Windows Common Dialogs "Per Monitor DPI-Aware"
- Set PerMonitorV2 DpiAwareness without manifest file?
- How to create high-dpi console applications on macOS with C# (if it is possible at all)?
- UIAutomation method ElementFromPoint() retrieves an incorrect element from Notepad on Windows 10
- confused about return of 'Screen.Bounds' in WPF and Winform
- Java disable dpi-aware not working
- MFC picture control changes size when DPI awareness disabled or running on Win7
- Why my WinForms appear all congested in [Design] mode VS2015
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Calling
SetProcessDPIAwaredoesn't just magically make everything DPI aware for you; its purpose is to declare to Windows that your app has been correctly written to be DPI aware. Furthermore, its use is not recommended; you're supposed to declare DPI awareness in your manifest instead. There's an entire article about this on MSDN.