i build these property for set\get the cursor position:
(i use 'Me', because i convert the UserControl to RichTextBox)
and heres how i use it:
why i get 1 error?
"Expression is a value and therefore cannot be the target of an assignment."
is because i use 'Y' instead a Point variable?
Code:
Public Property TextPos As Point
Get
Dim index As Integer = Me.SelectionStart
TextPos.Y = Me.GetLineFromCharIndex(index)
TextPos.X = index - Me.GetFirstCharIndexFromLine(TextPos.Y)
End Get
Set(value As Point)
Me.SelectionStart = Me.GetFirstCharIndexFromLine(value.Y) + value.X
End Set
End Propertyand heres how i use it:
Code:
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
Dim a As Integer = InputBox("please insert the line you need")
RichTextBox21.TextPos.Y = CInt(a)
End Sub"Expression is a value and therefore cannot be the target of an assignment."
is because i use 'Y' instead a Point variable?