[RESOLVED] Displaying text on a picturebox
I need a control for displaying text (coordinate values) as I move the mouse over a picturebox. I had thought of a label but I want to have more than one line. A multiline textbox won't work because it stays in the background underneath the picturebox so it's not visible. Any ideas?
Re: Displaying text on a picturebox
...and labels are nice because their backstyle can be set to transparent, otherwise maybe I'd use a picturebox.
Re: Displaying text on a picturebox
Not sure exactly what you are trying to achieve, but if you want to use a lable, then set its autosize property to true, the use VBCrLF for multi-line use, eg,
Lable1.caption = "This is on line one" & vbcrlf & "This is on line two".
Hope this is what you are wanting.
John
Re: Displaying text on a picturebox
Quote:
I had thought of a label but I want to have more than one line.
Labels can have multiple lines.
Code:
Private Sub Form_Load()
With Label1
.AutoSize=True
.BackStyle = vbTransparent
End With
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Caption = "X: " & X & vbNewLine & "Y: " & Y
End Sub
Re: Displaying text on a picturebox
Thank you jsmcm and brucevde. I thought I'd use vbcrlf for new lines but I must have done something strange for when I tried it didn't work (and I was sober) so I had already given up the idea.