简体   繁体   English

Windows Forms 程序在设计器中显示菜单项,并在程序运行时显示为彩色块

[英]Windows Forms program shows menu items as checked in designer and as a colored block when program runs

I've written a program in VS using C#, Forms and.Net Framework 4.8.我使用 C#、Forms 和 .Net Framework 4.8 在 VS 中编写了一个程序。 In the Designer, menu items show as checked.在 Designer 中,菜单项显示为选中状态。 When I run the program the items show with a colored block instead of a check.当我运行程序时,项目显示为彩色块而不是检查。 I've searched but can't seem to find any reference to a problem like this.我已经搜索过,但似乎找不到任何关于此类问题的参考。 Menu in Designer设计器中的菜单

Menu at run-time运行时菜单

I figured out what the problem was.我弄清楚了问题所在。 On the menuitem properties, there's a property called "ImageScaling" that defaults to 'SizeToFit'.在 menuitem 属性中,有一个名为“ImageScaling”的属性,默认为“SizeToFit”。 As soon as I set that to 'None' the check mark was in a small blue box (as I wanted it to be).一旦我将其设置为“无”,复选标记就会出现在一个蓝色的小框中(如我所愿)。 Thanks for your attention.感谢您的关注。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM