Sign in to follow this  

[.net] Drawing outside a control at design time

This topic is 4665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! Is it possible to draw outside a control at design time, for instance using a DesignerAttribute? The panel class seems to be doing this (in widbey)...

Share this post


Link to post
Share on other sites
The simple answer is, "Yes."

The correct answer depends on your intent.

Are you merely trying to draw beyond your boundaries, but remain on the form?

Are you planning on skinning other controls?

Are you wanting to implement additional design-time features? If so, why can't they be done via the Properties dialog?

Share this post


Link to post
Share on other sites
I would like some design time "candy"... what I would like to do is to have some X'es to remove rows and columns in a grid control. It's not important that they're partially outside the control, but I've seen it's been done, so I would like to see how ;)

Share this post


Link to post
Share on other sites
Well, you may be in trouble.

In VS.NET, you can draw outside the bounds of your control if you ask for create a Graphics object off of the control's parent. Of course, you'll have to remember to shift your graphics calls manually and Invalidate the form when you lose focus.

However, I don't know of a way in VS.NET 2002/2003 to capture mouse input outside of your control at design time. You may just end up creating small tool windows in the appropriate places on the screen...

Share this post


Link to post
Share on other sites
hmmmm... ok... It's not that important anyway.. it's just that having design time controls not cluttering up the control might make it easier to edit..

Share this post


Link to post
Share on other sites

This topic is 4665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this