|
-
Oct 30th, 2010, 09:54 AM
#1
Thread Starter
Lively Member
display description in property box
Hi,
I have made an options form, where I import my settings to a propertygrid by this code:
Code:
PropertyGrid1.SelectedObject = My.Settings
but now, the box in the bottom with the tag, displays the name of the setting too, and I want it to display the description I entered in the the settings...
I tried this to change the tag of setting "Backcolor" but it didn't work...
Code:
Private Sub PropertyGrid1_SelectedGridItemChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.SelectedGridItemChangedEventArgs) Handles PropertyGrid1.SelectedGridItemChanged
Dim pdc As PropertyDescriptorCollection = TypeDescriptor.GetProperties(PropertyGrid1.SelectedObject, True)
Dim pd As PropertyDescriptor
For Each pd In pdc
'Getproperty name
Dim strPropertyName As String = pd.Name
'MessageBox.Show(strPropertyName)
'Getproperty value
Dim strPropertytag As String = pd.GetValue(PropertyGrid1.SelectedGridItem.Tag).ToString
'MessageBox.Show(strPropertyValue)
'Changeproperty value
If strPropertyName = "Backcolor" Then
MsgBox("")
PropertyGrid1.SelectedGridItem.Tag = "blablabla"
End If
Next
End Sub
Furthermore I have some problems with organizing the settings, now they are all in "Misc' bye default, but I would like to create my own categories and put the settings in there own right category...
This problem I found by search, but it was unclear for me what to do, it didn't get resolved
http://www.vbforums.com/showthread.php?t=442940
Also, is there any possibility I can change the startposition of the line that seperates the names from the data in it?
any help is appreciated!
Last edited by LordWittie; Oct 30th, 2010 at 10:24 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|