|
-
Jun 15th, 2012, 03:22 AM
#4
Re: Line Control - Resizable/Movable at Runtime
First things first, don't use PictureBoxes for resize handles. The ControlPaint class looks after all that sort of stuff, e.g. selection rectangles, and the DrawGrabHandle method will draw proper grab handles.
As for the question, it's going to be tricky to create a custom control. Basically all controls are rectangular by default, hence the Bounds property being a Rectangle. You can create a custom Region in special cases, e.g. round Buttons, but if you wanted a Region that encompassed just your line and you want to be able to move just one end of the line then you'd have to change the Region as you went. Not impossible but not something I'd relish.
If it would suit your needs, it migh be better to do what I've done in my GDI+ examples in the CodeBank, i.e. use a single container, e.g. a PictureBox, and then draw your shapes directly onto that. I think that that's pretty much how a ShapeContainer works. Presumably it is transparent too. You could perhaps create a custom container for your shapes that was also transparent.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|