I have a problem in putting symbol like a dot in specific coordinates. How to i draw a circle with the use of VFD using the dots. Any tips to recommend? Thanks.
Its depended on what you use to draw circles. When you need to draw it in object on form (for example, container), you cannot because most VFP objects are not real Windows in API terms. You may use Form methods to draw something on form (include circles). But many other controls might cover any drawing you made on form. MS recommends to put drawing code in the Paint event of form so drawing will not be covered. Form.Paint called AFTER all other objects on form repainted, except Grid headers.
About coordinates - I recommend to use pixels in ScaleMode property. So left top coordinate of form will be 0,0; bottom-left - Width,Height.
Following are form methods that allow to draw something on form or related to drawing:
Box
Circle
Cls
Draw
Line
PSet
Paint event (put drawing code here)
Point
SetViewPort
Print (for text output)
TextHeight, TextWidth (sometimes useful)
Properties:
Various settings for color/font affect drawing
CurrentX, CurrentY
DrwaMode, DrawStyle, DrawWidth
ScalMode (pixels setting recommended, foxels come from FoxPro 2.6 coordinate system)
FillColor, FillStyle
You can also use all these methods for VFP _Screen object that is main VFP form, just to test something
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
Thanks for the tips. How about if I am using a sort of a map and when I zero in the coordinates I can see the content on that coordinate. More power to YOU!
Well, VFP is not quick enough to draw maps on the form surface. It is MUCH better to use some sort of good ActiveX control to show maps. When you need to put just text/simple mark over other control, just make label in run-time and put it where you need, or use shape(s) for this. For example, rectangular shape with rounded corners may become ellipse/circle. There are no triangular shape object, however, that is sad because I need to emulate it using many line objects... ;(
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
Thanks Vlad. I think drawing a map would be difficult. I'll revise my question to make it simplier. I have a program which has the coordinates. And upon encoding the coordinates my cursor will go on that coordinate (No problem with this). And on that coordinate where my cursor is located. I can draw a line which I could manipulate the direction of the line. What would be the command which I will be using to draw the line. You have mentioned about commands like Draw, Line, Paint Event. Do you think can I utilize this commands? Is this commands supported in VFP6? Thanks very much for your attention and help!
The following code may help you in monitoring the position of coordinates, but does not answer your main question
It is taken from the .MouseMove Event of a textbox and requires, in this example, a toolbar class with 2 spinners, .spnLeft and .spnTop. You may be able to adapt it for your project.
As the mouse moves, the coordinates show in the spinners. You could also use the spinners to reposition the form objects.
There may be help for you in the VFP sample applications also dealing with lines, shapes and coordinates [sig]<p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.