Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
152 views
in Technique[技术] by (71.8m points)

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

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).

enter image description here

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);
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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%.

enter image description here

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

enter image description here

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...