Why does Visual Studio 2015 form size changes when debugging? (C++/CLI)

拥有回忆 提交于 2019-12-13 08:08:38

问题


Decided to start working on a personal project creating a C++ program with a GUI. The idea that I had in mind was to practice what I'm learning in college by implementing it on a personal project.

After debugging it I noticed the size was quite off. For some reason, everything it scaling downwards when debugged. I'm guessing this has to do with Visual Studio not recognising my current screen resolution or conflict with my theme (which is an ordinary Windows 10 theme).

Please let me know if there's possibly a step I missed while implementing a GUI with C++ in Visual Studio, or if this is a known issue.

Thank you for your time and support through this early stages in my learning process.

#include "MainForm.h"

using namespace System;
using namespace System::Windows::Forms;


[STAThread]
void Main(array<String^>^ args)
{
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);

    cppGUI::MainForm form;
    Application::Run(%form);
}

回答1:


Figured out how to fix it!

I'm currently using a monitor connected to my laptop and have the laptop's monitor turned off. While re-checking the monitor settings I noticed I've been paying attention to my monitor's settings but not the settings my laptop's screen.

After checking I noticed that it was defaulting to 125%.

Managed to fix my problem after changing my laptop's screen to 100%.

Apparently, Visual Studio doesn't use your main display as it's reference. Instead, it uses the integrated display settings. So if anyone encounters a similar problem, remember to check all of your display settings (even the disabled ones).



来源:https://stackoverflow.com/questions/43032946/why-does-visual-studio-2015-form-size-changes-when-debugging-c-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!