Help appreciated. How do I build the functionality, such as found in Visio
etc., to enable selecting (activating) something like a rectangle or other
shape, and then resize and move the shape? Where/how do the mouse pointer
changes (from default to hand, double-arrow, etc.) happen? I want to give
this functionality to the user to allow resizing and moving simple shapes.
Mike D Sutton - 30 Nov 2004 16:30 GMT
> Help appreciated. How do I build the functionality, such as found in Visio
> etc., to enable selecting (activating) something like a rectangle or other
> shape, and then resize and move the shape? Where/how do the mouse pointer
> changes (from default to hand, double-arrow, etc.) happen? I want to give
> this functionality to the user to allow resizing and moving simple shapes.
Each shape would be a class instance that encapsulates how it draws itself to the display, knows it bounds rectangle and can
'hit-test' itself for user interaction. You then have a second object that contains a list of these shapes that has the ability to
hit test all of them (simply by calling the hit-test method of each one) and manages the mouse pointer depending on what was 'hit'
(either selecting/deselecting or on one of it's control handles.)
Since your second message to this group requests something similar in VB.NET code I'm assuming that this is also in .NET so you'll
need to post a more appropriate group for more assistance on the implementation of such an object model, have a look here for some
groups/pages you may want to try
Http://EDais.mvps.org/DotNet/
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: Http://EDais.mvps.org/
Ken Halter - 30 Nov 2004 16:32 GMT
> Help appreciated. How do I build the functionality, such as found in
> Visio
> etc., to enable selecting (activating) something like a rectangle or other
> shape, and then resize and move the shape? Where/how do the mouse pointer
> changes (from default to hand, double-arrow, etc.) happen? I want to give
> this functionality to the user to allow resizing and moving simple shapes.
Here's a start....
Regions (Clickable Shapes) Demo
http://www.mvps.org/vbvision/Sample_Projects.htm

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..