Chessie
07-30-2003, 11:56 AM
I am having difficulty trying to place a directional arrowhead (triangle) on a line object.
I create the lines as a control array when required and then need (somehow?) to create a directional arrow that appears in the middle of the line when created that points to the line coords x2 y2.
Is an ActiveX control the answer? however I still seem to get the line to move independently of the arrowhead (triangle).
Any help greatly appreciated
:confused:
BillSoo
07-30-2003, 01:06 PM
I had the same problem. Eventually I created an activeX control that did what I wanted. You *might* be able to find the code here if you did a search, but then again, some of the older posts will not be found in a search.
rbulph
07-30-2003, 02:05 PM
Personally I wouldn't bother with an ActiveX control. If you just use the Polygon API and brush up on your trigonometry, it shouldn't be too hard. That's how I've done it.
BillSoo
07-31-2003, 01:32 AM
True, but once you encapsulate the code in an activeX control, you don't have to rewrite it again for other programs.
rbulph
07-31-2003, 03:12 AM
True, but once you encapsulate the code in an activeX control, you don't have to rewrite it again for other programs.
I tried doing this with an ActiveX control, but it was important to me that the control had a transparent BackStyle in case any of the controls overlapped. And when I did that I found that anything that I painted on the control at runtime didn’t appear, even though the control’s AutoRedraw property was set to True. Plus if I added lines and shapes at design time there seemed to be odd pixels on their corners where the transparent setting didn’t work.
So instead I encapsulated the code in a class which has code for drawing the arrow on its WithEvents “Parent”, and receives an event when the mouse moves over the Parent so that it can detect whether the mouse is over the arrow it relates to, and it works fine. But I guess there are always different ways of achieving things.
Chessie
08-01-2003, 03:45 AM
Thanks Guys!
With your help I've sorted the problem.
Decided to write a sub with a bit of trigonometry number bashing in.
Cheers
Chessie
:) :) :) :)