how to draw a string bottom-left corner of a rectangle

wm.chatman

Well-Known Member
Licensed User
Longtime User
Hi

I need to draw a string on bottom left corner of rectangle.

The string is drawn starting from the top-left corner of the rectangle.
in use now.

form1.FDrawString("GPS: "& Format(GpsData.lat,"n4") & " : " & Format(GpsData.lon,"n4"),10,2,5,200,56,cBlack)

well how do I draw this so called string on the bottom left corner of a rectangle, using the above code?

Thank you much for your help.

Best regards.

William
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Must it be a rectangle?
would a panel do?
The thing is, each time you want to redraw the string, you will need to erase the previous one...
I do think this is the way to go to draw the string:
Compose the string, like

String = "GPS: "& Format(GpsData.lat,"n4") & " : " & Format(GpsData.lon,"n4"

Then get the lenght in pixels of the resulting string
Using that value, you can easily place the string where you want...
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
Hi Cableguy

OK. found out that a label direct will not work. So, how would I do this in order for it to work, using a Panel and adding a Label to said Panel? :BangHead:
 

klaus

Expert
Licensed User
Longtime User
Using a Panel with a Label will not solve your problem, it will get worse.

Why dosn't a Label work ?
You can set it to transparent and set the TextAlignment with the FormLib library to a right alignment.
This will be much easier than drawing onto the form's forelayer.

Best regards.
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
Good Morning Klaus.

of course you are right! Thank you. Solved. But, the transparent part does not work.
how's your GPS Program coming along?

have a nice day.

Best regards.
William
 
Last edited:
Top