简体   繁体   English

Visual Studio 2022 winform 设计器不在任何控件的属性 window 中显示 ApplicationSettings

[英]Visual Studio 2022 winform designer does not show ApplicationSettings in the property window of any control

In VS 2022 I create a new winform (.net 6.0) project.在 VS 2022 中,我创建了一个新的 winform (.net 6.0) 项目。 I put one textbox on the form.我在表格上放了一个文本框。 In the properties window, at the top, I'm used to seeing an item "ApplicationSettings" where I can bind the TEXT property of the textbox to an application setting.在属性 window 中,在顶部,我习惯于看到一个项目“ApplicationSettings”,我可以在其中将文本框的 TEXT 属性绑定到应用程序设置。 But I no longer see the line for "ApplicationSettings".但我不再看到“ApplicationSettings”这一行。 If I open an older winform project it works as expected.如果我打开一个较旧的 winform 项目,它会按预期工作。

The feature is (still) not available for WinForms .NET 6 but if you create a WinForms .NET framework project, it's available.该功能(仍然)不适用于 WinForms .NET 6,但如果您创建 WinForms .NET 框架项目,它就可用。

As a workaround, you can create the Application Settings yourself and add a user-scoped property like Property1 , then setup a databinding in code, like this:作为一种解决方法,您可以自己创建应用程序设置并添加一个用户范围的属性,如Property1 ,然后在代码中设置数据绑定,如下所示:

this.textBox1.DataBindings.Add(new Binding("Text", 
    Properties.Settings.Default, "Property1", true,
    DataSourceUpdateMode.OnPropertyChanged));
        

This worked for me, for the Visual Studio Community Version:这对我有用,适用于 Visual Studio 社区版本:

  1. Closed the entire Project/Solution in Visual Studio.在 Visual Studio 中关闭整个项目/解决方案。
  2. Reloading the.sln file in Visual Studio IDE along with the Dependencies.在 Visual Studio IDE 中重新加载 .sln 文件以及依赖项。
  3. Double Clicking the双击Form.cs[设计] (on the highlighted part) opened the Form in the Design format. (在突出显示的部分)以设计格式打开表单。

Hope this helps!希望这可以帮助!

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

相关问题 Visual Studio Winform设计器:在当前控件BindingSource上设置DataBindings - Visual Studio Winform designer: Set DataBindings on current control BindingSource (ApplicationSettings)未显示在表单属性上 - Visual Studio 2022 C# - (ApplicationSettings) not showing on form properties - Visual Studio 2022 C# Visual Studio设计器属性窗口与设计器文件 - Visual studio designer property window vs designer file winform-创建类似Visual Studio的锚属性控件的控件 - winform - Create control like Visual Studio's anchor property control 在 Visual Studio 的设计器中,为什么“选择资源”窗口中没有显示任何图像? - In Visual Studio's Designer, why don't any images show up in the Select Resource window? Visual Studio 2022 对 .xsd 设计器执行搜索 - Visual studio 2022 perform search into .xsd designer Visual Studio-从设计器窗口中删除自定义控件 - visual studio - remove custom control from designer window 从设计器中隐藏WPF控件的属性(Visual Studio 2010) - Hiding a property of a WPF control from the Designer (Visual Studio 2010) 从Visual Studio Designer /属性窗口中隐藏继承的公共属性 - Hide Inherited Public Property from Visual Studio Designer / Properties Window Visual Studio C#Winform Designer是否为控件成员创建奇怪的代码? - Visual Studio C# Winform Designer is creating strange code for control members?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM