为什么我的 Visual Studio (VB.NET) 布局在我的家用计算机上的设计视图与运行时不同,但在我的工作计算机上却相同? [英] Why is my Visual Studio (VB.NET) layout different in Design View vs. at run-time on my home computer, but identical on my work computer?
问题描述
我一直在使用 Visual Studio 2013 在 VB.NET 中的工作计算机上使用 Windows 窗体开发程序.当我在工作计算机上运行它时,运行时的窗体看起来与设计视图中的窗体相同 -相同的整体尺寸、相同的布局等.这是在我的工作计算机上的外观 - 以及当我从我的家用计算机通过远程桌面访问我的工作计算机时.
I've been developing a program with Windows Forms on my work computer in VB.NET using Visual Studio 2013. When I run it on my work computer, the forms at run-time look identical to the forms in design view - the same overall size, the same layout, etc. Here is what it looks like on my work computer - AND when I access my work computer over remote desktop from my home computer.
但是,在我的家用计算机上,它的设计视图与运行时不同.设计视图中的表单较小且标签未对齐.
However, on my home computer, it looks different in design view than at run-time. The form in design view is smaller and labels are misaligned.
两台计算机都使用相同的设置运行 Visual Studio 2013.我正在家里使用更大的显示器,但是当我通过远程桌面访问我的工作计算机时一切正常,这让我认为这不是我的显示器.
Both computers are running Visual Studio 2013 with the same settings. I'm working on a larger monitor at home, but the fact that things look right when I access my work computer over Remote Desktop makes me think it's not my monitor.
我的工作计算机是 Windows 7,而我的工作计算机是 Windows 8.1.
My work computer is Windows 7 while my work computer is Windows 8.1.
我尝试过的事情:
- 锚定/停靠标签,但布局最终看起来不对
- 将 AutoScaleMode 更改为 DPI 而不是字体,但这只会在运行时更改外观,而不是在设计视图中,它仍然与设计视图不匹配.
有什么想法吗?
推荐答案
我想通了!这是我家用电脑上的 Windows 设置.(仍然不清楚为什么它通过远程桌面看起来是正确的,但它可能使用远程计算机的设置而不是本地计算机的设置).
I figured it out! It was a setting in Windows on my home computer. (Still unclear why it looked right via Remote Desktop, but maybe it uses the remote computer's settings instead of the local one's).
解决方案是:
- 右键单击,选择屏幕分辨率"
- 点击放大或缩小文本和其他项目"
- 选中让我为所有显示器选择一个缩放级别"并将大小设置为更小 - 100%"
出于某种原因,在我的家用电脑上,大小设置为 125%.
For some reason, on my home computer the size was set to 125%.
这篇关于为什么我的 Visual Studio (VB.NET) 布局在我的家用计算机上的设计视图与运行时不同,但在我的工作计算机上却相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!