Discussion:
Pb of text location
(too old to reply)
f***@gmail.com
2013-07-05 12:05:54 UTC
Permalink
Hello ,

I am writing at the same place on a picture box , a line with drawline and a text with drawstring ,
when i change the size of the picture box (the picture box has then a greater area than the form windows , line and text are no more displayed at the same location.
I am rather surprised.

Here is the code
Dim start As New Point(100, 100)
Dim start1_main As New Point(100, 50)
Dim start1 As New Point(50, 50)
Dim [end] As New Point(Me.ClientSize)
Dim my_rect As New Rectangle

Dim paintee As Control = DirectCast(sender, Control)

'Translate the points relative to the control being painted.
start = paintee.PointToClient(Me.PointToScreen(start))
start1_main = paintee.PointToClient(Me.PointToScreen(start))
start1 = paintee.PointToClient(Me.PointToScreen(start))
[end] = paintee.PointToClient(Me.PointToScreen([end]))
e.Graphics.DrawLine(Pens.Black, start, [end])

e.Graphics.DrawString(displaycomm_main, objpolice1_main, System.Drawing.Brushes.Yellow, start)


FRanck serval
Deanna Earley
2013-07-05 14:04:14 UTC
Permalink
Post by f***@gmail.com
Hello ,
I am writing at the same place on a picture box , a line with
drawline and a text with drawstring , when i change the size of the
picture box (the picture box has then a greater area than the form
windows , line and text are no more displayed at the same location.
I am rather surprised.
Here is the code
<SNIP>

That is VB.Net using the .NET framework/GDI+.
You may have better luck in a GDI+ or VB.Net newsgroup.
--
Deanna Earley (***@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
Continue reading on narkive:
Loading...