Custom Property Designers and Parent objects? 
Author Message
 Custom Property Designers and Parent objects?

Does anybody know whether it's possible to pass data to a custom property
editor?

I'm using a class of properties which I display in a property grid.  I've
got my property editor set up so that it drops down when the user clicks on
the drop button.

The problem is I need to get access to other properties in the class for the
editor control to work (i.e. the user selects a file which is stored in a
property, I need to pass that path to the property editor).  The
DefaultValue attribute has to be a constant so you can't pass it through
that!

Any Ideas other than using a <SHOCK, HORROR> Global variable..

P.S anyone know how to get the width of the property grid so I can set my
drop down to the right width?



Mon, 25 Apr 2005 01:45:28 GMT  
 Custom Property Designers and Parent objects?
Look at the ITypeDescriptorContext parameter that is passed in the EditValue
method of your editor. It has an Instance member that is the instance of the
component that is currently being edited.

HTH

Antoine
Microsoft Visual Basic .NET

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> Does anybody know whether it's possible to pass data to a custom property
> editor?

> I'm using a class of properties which I display in a property grid.  I've
> got my property editor set up so that it drops down when the user clicks
on
> the drop button.

> The problem is I need to get access to other properties in the class for
the
> editor control to work (i.e. the user selects a file which is stored in a
> property, I need to pass that path to the property editor).  The
> DefaultValue attribute has to be a constant so you can't pass it through
> that!

> Any Ideas other than using a <SHOCK, HORROR> Global variable..

> P.S anyone know how to get the width of the property grid so I can set my
> drop down to the right width?



Sun, 01 May 2005 04:10:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB 6.0 Data Designer - Parent/Child object open error

2. Creating Parent property for a custom class

3. Windows forms designer automatically adds code that sets properties of custom controls

4. Accessing Custom Properties in Forms -- Parent and Child ?

5. Lost Custom Controls/Designers/Insertable Objects

6. Properties from Parent Objects

7. CDO: Parent property always returns session object

8. activex parent and extender properties/object problems

9. : can I have a database object as a property of a custom OCX

10. Property bag and custom objects

11. Recursing thru properties in a custom object

12. Custom Property changes in Custom Outlook Form

 

 
Powered by phpBB® Forum Software