Adding description and category to my.settings via Settings.Designer.vb?

  • Thread starter Thread starter JesperSP
  • Start date Start date
J

JesperSP

Guest
I want to use the PropertyGrid to let users change the settings of my vb.net program

I simply put

PropertyGrid1.SelectedObject = My.Settings

It works pretty nicely, but it would be even nicer if the settings could be categorized and described.

I found that I can edit the Settings.Designer.vb file, adding description and category like this


<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("c:\barcode\Barcode+text.lbx")>
<Description("Path to the barcode template file"), Category("Barcode")>

Public Property Barcode() As String
Get
Return CType(Me("Barcode"),String)
End Get
Set
Me("Barcode") = value
End Set
End Property

With this the settings look even nicer.

Unfortunately the added <Description, Category> disappears when I add new settings to the program, because the file is auto-generated.

Is it possible to put description and category somewhere else ? so it doesn't get deleted by auto-generated files?

Cheers,

Jesper

Continue reading...
 
Back
Top