English 中文(简体)
Is it possible to set the DPI of an application programatically?
原标题:

Is it possible to set the DPI of an application programmatically or the DPI only possible to set through the system preference?

Note: My application s GUI is coded in MFC and .NET forms.

Update: After some research I have found no way of doing this so I have to agree with the only answer here; it cannot be done.

最佳回答

Assuming that you are talking about the Windows system-wide setting that determines the ratio between the physical DPI setting (that depends on the physical screen + resolution), the simple answer is "you can t", at least, not on at the application level in a WinForms app.

What you can do, is add scaling code to your form, see this StackOverflow entry. Basically, set the AutoScaleMode to ScaleMode.Dpi. See the other entry for more info.

问题回答

暂无回答




相关问题
Problem statically linking MFC libraries

I have a Visual Studio 6 workspace I m trying to convert to a Visual Studio 2008 solution. The output of said solution is a .dll. It has to be a .dll and it needs to statically link MFC as I can t ...

Switching to WPF. Is it time?

I m considering switching from MFC to WPF. My first concern is that there are too many users who don t have .NET with WPF installed yet. Can anybody point to a source containing the WPF penetration ...

Crash within CString

I am observing a crash within my application and the call stack shows below mfc42u!CString::AllocBeforeWrite+5 mfc42u!CString::operator=+22 No idea why this occuring. This does not occur ...

C# for UI, c++ for library

I have a numerical library coded in C++. I am going to make a UI for the library. I know some MFC. So one solution is to use MFC and make a native application. The alternative is C#. I know nothing ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

MFC List Control

In MFC, I can edit the text of items in the list control but only for the first column by setting the Edit Labels to true. Now when I click the first column item to change its text, I m able to change ...

热门标签