Custom Shaped Usercontrols

XL Jedi

Active member
Joined
Apr 2, 2007
Messages
44
Location
Florida
Programming Experience
10+
I'm trying to build a custom usercontrol for a graphical "node" type control.

The node will serve as connector points for lines in a 2D graphical application. Presently, I have figured out how to create the control, draw the node image and have it display properly when dropped on a container userform.

When I draw the node image it's an n-sided polygon. I gave the control a property called "sides" that allows me to change it to however many sides I want and as I change the property, the control image updates properly to show the node with it's new shape.

Now I'm working on the following:

1) By default, the inherited UserControl object gets dropped onto the userform with a rectangular outline and 8 resizing gadgets. I really want the shape of the underlying polygon graphic to dictate the hittest area. So I need to figure out how to make the UserControl shape match my polygon.

2) Transparency. The area inside and outside the polygon outline needs to be transparent, while the hittest area needs to be the area inside the polygon.

3) Rotation gadget. Presently, I have a Rotation property that allows me to change the rotation of the polygon 0-360. I would like to create a rotation gadget that I could click and drag at design time. Anyone done anything like that?
 
Back
Top