Windows Develop Bookmark and Share   
 index > Windows Forms General > property grid questions
 

property grid questions

I'm using property grids to replace some intricate windows forms in a business application - so far so good, the code is much simpler and the user community seem to like what they see.

What I now need to do is to implement PropertyTabs for the detailed and optional data "tables" (it's not a database app as such, the information resides in various imbedded systems - hence the rabbit's ears). What I'd like to do is to write a class for each detailed/optional "table", that the user would drive via a drop down button in the PropertyGrid's ToolStrip, similar to the Events button.

So I wrote a couple of classes based on PropertyTab, added them via PropertyGrid.PropertyTabs.AddTabType but "nothing happens" - the GetProperties method is never called. The only example I can find is the one in the library which states that property tabs are defined via a PropertyTab attribute,. However its not clear to me, to what object I should apply the PropertyTab attribute.

Also what is the Command Pane, there's a bunch of colors that one can specify, but how does one create an actual command? Is the command Pane used in the VS IDE, if so whereabouts is that, if I could see an example then I can probably wrap my head around whatever is the Command Pane does.

Most of the information I can find about property grids assumes that they are only used at design time, if anyone knows of any articles that don't make this assumption I appreciate a pointer in the direction thereof. Indeed the whole area of components needs a decent book - any recommendations ?

Thanks PhilD



RightPaddock  Wednesday, June 13, 2007 7:02 AM
If anyone cares - the commands pain (sic) is the one above the help pane from which Designer verbs can be accessed - why they are called "Hot Commands" in some places and "Designer Verbs" in others is beyond me - NET's complex enough without resorting to multiple names for the same thing.

Still trying to work out PropertyTabs, stumbled on Shawn Burke's article "Make Your Components Really RAD with Visual Studio .NET Property Browser", I'll spend what promises to be a rainy weekend reading it and his code - it's the best article I've seen on Property Grids so far.

My users have asked if absent data can be highlighted in different colors - preferably via Display Names; e.g. Red meaning "this really should have a value", Yellow meaning "this ought to have a value" and Green meaning "by the way this has no value". Any ideas?
RightPaddock  Friday, June 15, 2007 4:30 AM
was not able to implement propertyTabs declaratively but once the "penny dropped" it was simple to implement procedurally.

create a class on propertyTab eg - internal class myPropertTab : PropertyTab

fill in the blanks required by PropertyTab (it's abstract), see Shawn's previously article for example. add the ProperyTab class to you PropertyGrid via the PropertyTabs.Add method. The additional property tabs MUST be added before adding any other items to the Property Grid Toolstrip , or you must remove them first then put them back.
RightPaddock  Friday, June 29, 2007 3:37 AM

You can use google to search for other answers

Custom Search

More Threads

• problem with toolstrip
• How to stretch a line?
• How to get the complete scrollable height and width of a control
• System Tray icon does not disappear
• Where to download AppUpdater for Framework 1.0 ?
• Form Resizing Problem
• Form Activated Event Going in multiple loops
• Making a persistant non-modal form
• Adding stuff to combobox in module
• DatetimePicker