Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pb of text location

7 views
Skip to first unread message

franck...@gmail.com

unread,
Jul 5, 2013, 8:05:54 AM7/5/13
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

Deanna Earley

unread,
Jul 5, 2013, 10:04:14 AM7/5/13
to
On 05/07/2013 13:05, franck...@gmail.com wrote:
> 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 (dee.e...@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.)
0 new messages