John J. Murphy

I am trying to create a set of custom controls which are essentially rectangles of different fixed sizes.

However these need to be moveable by the form user within a scrollable area on the parent form, and need some kind of standard 2d drawing control points (like, say, the control points on a drawing object you would put into a PowerPoint slide).

They need to be constrained, however, to

(a) "sliding" in one of four directions per their current rotation, or...

(b) "wheeling" about one of their four corners.

I also need to be able to tell, as the user is performing these operations, when the bordering segments (rotated and translated) "hit" those of another such control.

The control needs to paint itself with some custom image which rotates and translates with the control.

Real-time/animation performance should not, I think, be an issue as the only moving control would be the one the user is manipulating at any moment.

I am prety handy with math and matrix scaling/rotation/translation if needed but perhaps that is not really needed here if there is already support for these.

I would prefer to inherit rather than code from scratch and would like to use what I can within managed windows code - keeping the written code down to as few lines as practical.

I am writing in C# using Visual Studio Express.

Okay, I have looked into the following:

http://msdn2.microsoft.com/en-us/library/f152hbx4.aspx

which describes using regions for a button control.

But... I am not sure whether this will actually permit two such controls to butt together within the same "bounding rectangle" normalized to the form, nor do I have a clue as to how to have rotate/drag edge/corner control points like a standard 2d drawing object rather than a "button-click" orientation one would expect from inheriting from a button control.

Does anyone have some ideas as to how to best and easiest approach this



Re: Windows Forms General custom controls - translated/rotated rectangles with "standard" 2D drawing control points

nobugz

You can't use the standard designer resize handles to do this. It will take some very serious surgery to the UI designer for your controls. I'll move your thread to the Windows Forms Designer forum.





Re: Windows Forms General custom controls - translated/rotated rectangles with "standard" 2D drawing control points

John J. Murphy

Why did this get moved to the designer forum - the moderator statement above indicates the question was not understood, perhaps poorly written although I tried to explain as best I could

The question is _not_ how to do this for a developer to use in the forms designer _design-time_, it is how to do this in a one-off app for the user of the aplication to manipulate.

Please move back if appropriate.





Re: Windows Forms General custom controls - translated/rotated rectangles with "standard" 2D drawing control points

nobugz

Okay.