为什么调试时Visual Studio 2015表单大小会更改? (C ++ / CLI) [英] Why does Visual Studio 2015 form size changes when debugging? (C++/CLI)

查看:257
本文介绍了为什么调试时Visual Studio 2015表单大小会更改? (C ++ / CLI)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

决定开始从事使用GUI创建C ++程序的个人项目。我想到的想法是通过在个人项目上实现我在大学里所学的东西。

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.

调试之后,我发现尺寸已经很大。出于某种原因,调试时所有内容都会向下缩放。我猜想这与Visual Studio无法识别当前的屏幕分辨率或与主题(这是普通的Windows 10主题)冲突有关。

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

请告诉我在Visual Studio中使用C ++实现GUI时是否错过了某个步骤,或者

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.

感谢您在我学习过程的早期阶段的时间和支持。

#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);
}


推荐答案

找出了解决方法!

我当前正在使用连接到笔记本电脑的显示器,并且已关闭了笔记本电脑的显示器。重新检查显示器设置时,我注意到我一直在注意显示器的设置,而不是笔记本电脑屏幕上的设置

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.

之后检查中,我注意到它默认为125%

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

在更改我的问题后设法解决了我的问题笔记本电脑的屏幕显示到100%。

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

< img src = https://i.stack.imgur.com/UABBR.png alt =在此处输入图片描述>

显然, Visual Studio不使用您的主显示作为参考。而是使用集成的显示设置。因此,如果有人遇到类似问题,请记住检查所有显示设置(甚至禁用的设置)。

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

这篇关于为什么调试时Visual Studio 2015表单大小会更改? (C ++ / CLI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆