franck...@gmail.com
unread,Jul 5, 2013, 8:05:54 AM7/5/13You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
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