
chce osiągnąć to, ale....funkcja ma działać TYLKO WTEDY, gdy textbox NIE JEST ZAZNACZONY (edytowany)

jak to osiągnąć ? :D
bo myslalem po prostu aby zrobić wciskanie klawiszy Pg UP i PG Down...ale to się będzie mijalo z celem :P i nie zda egzaminu =/

chce osiągnąć to, ale....funkcja ma działać TYLKO WTEDY, gdy textbox NIE JEST ZAZNACZONY (edytowany)

jak to osiągnąć ? :D
bo myslalem po prostu aby zrobić wciskanie klawiszy Pg UP i PG Down...ale to się będzie mijalo z celem :P i nie zda egzaminu =/
Zmieniaj HorzScroll
mi głównie chodzi o to , jak zrobić warunek "if textbox1 selected = false" czy cos w ten deseń
Private Sub TextBox6_GotFocus(sender As Object, e As EventArgs) Handles TextBox6.GotFocus
TextBox6.BackColor = Color.Yellow
End Sub
Private Sub TextBox6_LostFocus(sender As Object, e As EventArgs) Handles TextBox6.LostFocus
TextBox6.BackColor = Color.White
End Sub
ok getfocus i lostfocus działa...ale odnośnie tych napisów..w jaki sposób zastosować te horzscroll ?
Timer Interval na 2000 i:
Private Function GetVisibleCharsCount(TextBox As TextBox) As Integer
Dim tmpText As String = ""
GetVisibleCharsCount = 0
Dim avg As Size
For Each ch As Char In TextBox.Text.ToCharArray
tmpText &= ch
avg = TextRenderer.MeasureText(tmpText, TextBox.Font)
If avg.Width <= TextBox.ClientRectangle.Width Then
GetVisibleCharsCount += 1
Else
Exit Function
End If
Next
End Function
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If TextBox1.SelectionLength = 0 Then
TextBox1.SelectionStart = GetVisibleCharsCount(TextBox1)
TextBox1.SelectionLength = TextBox1.TextLength
TextBox1.ScrollToCaret()
Else
TextBox1.SelectionStart = 0
TextBox1.SelectionLength = 0
TextBox1.ScrollToCaret()
End If
End Sub