Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将类别和其他此类属性添加到应用程序设置(在vb.net中)?_Vb.net_Visual Studio 2010 - Fatal编程技术网

如何将类别和其他此类属性添加到应用程序设置(在vb.net中)?

如何将类别和其他此类属性添加到应用程序设置(在vb.net中)?,vb.net,visual-studio-2010,Vb.net,Visual Studio 2010,好的,我有一个PropertyGrid控件,它显示了我的(用户)应用程序的所有设置,这很酷,但我希望我的设置被分类,并有描述等等 所以我环顾四周,发现如果我插入以下代码: Global.System.ComponentModel.Category("Category Name :D") Global.System.ComponentModel.DisplayName("Display Name") Global.System.ComponentModel.Description("whatevs

好的,我有一个PropertyGrid控件,它显示了我的(用户)应用程序的所有设置,这很酷,但我希望我的设置被分类,并有描述等等

所以我环顾四周,发现如果我插入以下代码:

Global.System.ComponentModel.Category("Category Name :D")
Global.System.ComponentModel.DisplayName("Display Name")
Global.System.ComponentModel.Description("whatevs")
进入Settings.Designer.vb文件中的每个属性,如下所示:

    '''<summary>
    '''This Setting dose some stuff
    '''</summary>
    <Global.System.ComponentModel.Category("Category Name :D"), _
     Global.System.ComponentModel.DisplayName("Display Name"), _
     Global.System.ComponentModel.Description("whatevs"), _
     Global.System.Configuration.UserScopedSettingAttribute(), _
     Global.System.Configuration.SettingsDescriptionAttribute("This Setting dose some stuff"), _
     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
     Global.System.Configuration.DefaultSettingValueAttribute("Stuff")> _
    Public Property FOLDER_OutputRealm() As String
        Get
            Return CType(Me("Stuff_Setting"), String)
        End Get
        Set(ByVal value As String)
            Me("Stuff_Setting") = value
        End Set
    End Property
“”
''这个设置有一些东西
'''
_
公共属性文件夹\u outputream()作为字符串
得到
返回CType(Me(“填充设置”),字符串)
结束
设置(ByVal值作为字符串)
Me(“东西设置”)=值
端集
端属性
我会得到我想要的,也就是说,直到我更改了设置中的某些内容并导致settings.Designer.vb文件重新生成,从而丢失了所有自定义更改


在VB.NET中,为应用程序设置分配类别/显示名/描述的正确方法是什么?

您可以在listview中添加或生成全局值…但是PropertyGrid控件更酷~酷是需求规范的一部分吗?没错。此外,在应用程序设置中添加类别和描述似乎是你完全可以做到的事情。