Results 1 to 17 of 17

Thread: [RESOLVED] Highlight Text on TextBox Enter

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    817

    Resolved [RESOLVED] Highlight Text on TextBox Enter

    I'm certain this was working at some stage. Wondering why it isn't now.

    HTML Code:
        Private Sub EnterTextBox(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNoBars.Enter, txtMultiplier.Enter, txtCenters.Enter
            'DirectCast(sender, System.Windows.Forms.TextBox).SelectAll() 'On entering the textbox select all text
            Dim myTextBox = DirectCast(sender, System.Windows.Forms.TextBox)
            myTextBox.SelectionStart = 0
            myTextBox.SelectionLength = myTextBox.Text.Length
        End Sub
    I've stepped through the code and there's nothing past this.
    Last edited by sgrya1; Oct 19th, 2021 at 03:54 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width