PropertyGrid PaintValue problem: How to remove (and paint outside) the standard rectangle?

Posted by Pedery on Stack Overflow See other posts from Stack Overflow or by Pedery
Published on 2010-03-24T22:54:14Z Indexed on 2010/03/25 0:53 UTC
Read the original article Hit count: 727

Filed under:
|
|
|
|

This might be a straightforward question, even though I haven't found an easy solution to it:

I've implemented my custom UITypeEditor with the sole purpose of adding a PaintValue to bools. For the sake of the discussion, let's assume that PaintValue will either paint a checked or unchecked radiobutton.

Question 1:

Now, here's the problem: It seems like PaintValue automatically inserts a 20x13px rectangle after all paint code has completed. Naturally, a radiobutton inside a black rectangle is ugly. Can I easily instruct or override this rectagle not to be painted?

Question 2:

In this respect, is it possible to paint on top of the propertygrid's native look - meaning could I paint something in order to obscure (part of) the black line separating two grid cells vertically? The purpose of doing this would be to indicate that two values were linked, like constrained width/height to an aspect ratio.

© Stack Overflow or respective owner

Related posts about c#

Related posts about propertygrid