|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need help on some PropertyGrid and PropertyGridView membersI'm looking for a way to test the application with the PropertyGrid control, namely, to programmatically obtain grid items, select items, etc. I explored the PropertyGrid object with the test tool and found a number of protected (or maybe even private) members that I guess can help me with my task. The problem is, these members are not documented in MSDN. I tried Google search but haven't found anything on these members either. Well, the purpose of some of them, e.g. PropertyGrid.GetPropEntries(), or PropertyGridView.SetExpand (GridEntry, boolean) is obvious. However, I got stuck trying to understand what the others do. Could anyone provide me some information on these methods and their parameters? Thanks in advance, Helen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Methods of the PropertyGrid class: boolean GetScrollState (int) int GetSelectState() boolean GetState (int) void SetSelectState (int) void SetState (int, boolean) Methods of the PropertyGridView class: GridEntryCollection GetAllGridEntries (boolean) int CountPropsFromOutline (GridEntryCollection) int GetGridEntriesFromOutline (GridEntryCollection, int, int, GridEntry[]) GridEntryCollection GetGridEntryHierarchy (GridEntry) GridEntry FindEquivalentGridEntry (GridEntryCollection) int GetCurrentValueIndex (GridEntry) int GetPropertyLocation (String, boolean, boolean) boolean GetState (int) void RecursivelyExpand (GridEntry, boolean, boolean, int) void SelectGridEntry (GridEntry, boolean) void SetState (int, boolean) void SelectEdit (boolean) > Methods of the PropertyGrid class: With these Protected methods above in particular, they're used by the > > boolean GetScrollState (int) > int GetSelectState() > boolean GetState (int) > void SetSelectState (int) > void SetState (int, boolean) Control or the Control's parent internally for GUI purposes. They're not meant for use during run time for any designed purpose except for the Application to surf through control handles and use the events for rendering the control's based on the control's current state etc. I haven't used the PropertyGrid control before but by the looks of some of the methods you listed below, most of them are Protected for internal handle use. Some method names like RecursivelyExpand (GridEntry, boolean, boolean, int) actually have run time public versions which expand TreeView controls that exist inside the PropertyGrid control. Anything that's documented as Private is generally not documented at all and, at most, only the method name is documented. Mainly because there is no way you can break the type saftey of the class to execute the private methods. The Heirarchy of Class access and execution is: Public - Any external class can execute this method or access this property Protected - Only Authorised (Generally .Net Framework Engine Only) classes can access these methods and properties Private - No chance at all to access these methods or properties. If you are intending on using Protected methods or members, you can use unmanaged code to access them through the .Net marshal. I've never done this for controls. Before .Net 2005 came out, I used to use the Marshal to access COM ports with unmanaged C++ code within C# managed code applications. Hope this is of any use at all :o) Hi Andrew,
Thanx for the info. Actualy, I know about the access types, and that it's impossible to call protected/private members from the application source code. However, I CAN call the internal members from scripts created in out test automation tool, indeed (you see, it provides access to all members of application's objects, even those which are protected and private). I already found some of the internal methods of these objects very useful when implementing a part of the needed test functionality. For example, I was able to determine coordinates of a particular property value cell, or coordinates of the "+"/"-" buttons (in order to simulate mouse clicks on them then), and so on. As to the listed above methods, I looked at their names and thought they might be helpful too... BTW, I've found a way to learn the purpose of these methods. At the moment, I'm trying .NET Reflector to do the reverse engineering. It works excellent, so I can see the decompiled code and finally understand what these methods do and if they can be helpful for me (and if I don't break anything by using some of them :-) ).
Other interesting topics
toolstrip container backcolor and gradients - I want it to look like outlook 2003!
OT: Crossword Puzzle Creator - .NET Source GroupBox and/or Tab Control Font Colours MDI app - don't load document twice ClickOnce deployment, include font Displaying a status image in a datagridview Drawing special text with gradient colors (Windows Forms VB.NET 1. datagridview - don't want any rows selected initially.... Generating 3D graphs in .Net 2.0 windows forms. How to make a DataGridViewComboBox column more reactive? |
|||||||||||||||||||||||