PropertyGrid customization

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi,

I'm in the process of customizing the PropertyGrid for an
application. I've written several TypeConverters and a
few editors to display and process data within the grid.
What I haven't been able to do yet is have the editor
control receive the mouse input from another window.

For example, I have a CAD app and I want modify a line
entity. I select the entity and its properties are
displayed in the PropertyGrid. I select the beginning
coordinate field in the PropertyGridwant to modify the
coordinate of the beginning point by selecting the
location in the graphics window. Is this possible, or do
I just need to create my own custom version of the
PropertyGrid??

What I would ideally like to do is embed an existing
custom control inside the PropertyGrid.

TIA,
Peter
 
You can make a UITypeEditor that responds to mouse operations. The sample
Angle editor is such a control.

To edit a property from a main graphics window, just update the property in
the selected object as normal by editing with the mouse and refresh the
property grid at each mouse move. The values will be updated.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com
 
I found the AngleEditor and applied the changes to my
codes. It did display my custom control correctly.
However when I proceded to pick the coordinate location,
which is in a seperate window, the control never received
the input. Probably because the control is dismissed
when you click outside of it. If I type the coordinate
in the custom control it works correctly.

There seems to be a dialog created behind the scenes
which hosts the control. This dialog also seems to be
altering the focus. When the PropertyGrid is displayed,
the focus is still on the main window of the app. When
you click the down button the focus is no longer on the
main window of the app.

I know AutoCAD had a control on the PropertyGrid which
works the way I want mine to. I don't know if they have
created a custom PropertyGrid or not.

Any thoughts??

Peter
 
Back
Top