0

I am working in a VB6 to VB.NET migrated project.In VB6 I have a picture box in runtime design a form using the Graphics.Suppose I have a two labels lbl1 and lbl2 just to the right when we mousedown on the picture box showing a textbox to enter text.The Entered Text is Visible after the LostFocus in a Textbox.In VB6 after saving the data and reopening the same form the saved text is correct position showing right to the label .

In VB.NET it is not happening.In VB6 they have written just

picture1.Print "Hi".

But in VB.NET we need to write provide the position also.Could any one help me regarding this ?

Hemant Kumar
  • 4,593
  • 9
  • 56
  • 95
  • you might want to include a screen shot (or a link to one), in order to help others understand exactly what you are expecting. – jmoreno Oct 25 '12 at 07:28

1 Answers1

0

Atlast I solved my problem as given below.

Measured the label width as given below

                Dim stringSize As New SizeF

                Dim labelText as String=lbl.Text
                stringSize = eventArgs.Graphics.MeasureString(labelText,Font.TimeNewRoman
Hemant Kumar
  • 4,593
  • 9
  • 56
  • 95