Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
I am working in VB6. I have to draw an arc through three-point on a Form. I dont know how to start doing this! I have this question with your ideas to help me solve it. Thanks.
Posted

1 solution

1. To draw on a Form, you need to subclass the form an override Control.OnPaint[^]. This gives you access to a GDI+ Graphics[^] object that you use to draw.

See User-Drawn Controls[^] or Custom Drawing User Control Sample[^].

2. To draw an arc through 3 points, see Ellipses and Arcs in GDI+[^] or Graphics Paths in GDI+[^].

Follow-up:

Sergey is right. #1 applies to Windows Forms (.NET), and won't help you.

#2 should still work but you still need access to a GDI+ Graphics object. It is possible, but not as easy with VB6. These may help:

A GDI+ Introduction for Visual Basic 6 Programmers[^]

GDI+ wrapper for VB6[^]
 
Share this answer
 
v2
Comments
Andrewpeter 4-Feb-14 9:52am    
Thanks. GDI+ with VB6 is a difficult problem. I'll try to do it. My vote is 5 for you.
Sergey Alexandrovich Kryukov 4-Feb-14 11:10am    
It won't work for you at all. The solution of for .NET. A good idea is to forget VB6 forever as nightmare. It was never any adequate tool, even at the moment of its introduction to the market.
—SA
Sergey Alexandrovich Kryukov 4-Feb-14 11:08am    
Unfortunately, none of those referenced articles solve this particular simple mathematical problem... It should be solved from scratch, it may or may not have the solution or have many solutions, etc...
—SA
Yvan Rodrigues 4-Feb-14 11:57am    
Right you are, my bad. See follow-up.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900