Displaying help in property grid control
-
Hey, I'm using a property grid control to display some user options for my applications. So, basically I have a big Settings class with all the properties associated with the property grid control and then the user can just change them. However there's a help frame in the property grid control and I'd like to be able to display some help text in there for each property : pretty much as Visual Studio does. Can someone help please? Thanks Allad PS : if you know of an easy and prettier class for options dialogs in C#, I'm all ears.
---- Navigator - Your best alternative to Windows Explorer
-
Hey, I'm using a property grid control to display some user options for my applications. So, basically I have a big Settings class with all the properties associated with the property grid control and then the user can just change them. However there's a help frame in the property grid control and I'd like to be able to display some help text in there for each property : pretty much as Visual Studio does. Can someone help please? Thanks Allad PS : if you know of an easy and prettier class for options dialogs in C#, I'm all ears.
---- Navigator - Your best alternative to Windows Explorer
You can use the DescriptionAttribute[^] class to set the text of the "help frame" of a property grid. In addition, you can use the CategoryAttribute[^] class to group related properties within the grid. -Phil
-
You can use the DescriptionAttribute[^] class to set the text of the "help frame" of a property grid. In addition, you can use the CategoryAttribute[^] class to group related properties within the grid. -Phil
-
thanks a lot. It's working perfectly. Is it some kind of hack? It doesn't look like usual C# syntax. Anyway, It is exactly what I'm looking for.
---- Navigator - Your best alternative to Windows Explorer
Nope, no hacks required. It was designed to look that way. :-) It's C# attribute[^] syntax. .NET allows you to attach additional bits of "metadata" to .NET objects (assemblies, classes, methods, and properties). Other .NET objects (such as the PropertyGrid) can then extract that data for their own purposes (such as displaying descriptions of properties). -Phil
-
Nope, no hacks required. It was designed to look that way. :-) It's C# attribute[^] syntax. .NET allows you to attach additional bits of "metadata" to .NET objects (assemblies, classes, methods, and properties). Other .NET objects (such as the PropertyGrid) can then extract that data for their own purposes (such as displaying descriptions of properties). -Phil
Wow. Thumbs Up man. you got to be some kind of C# guru to know all that stuff. Thanks a lot for your time. Now I may sleep with a better conscience.(I don't really like using hack stuff when I can help it). Regards, Allad
---- Navigator - Your best alternative to Windows Explorer