cpopham Posted March 8, 2005 Posted March 8, 2005 I have forgotten how to do this and can not find out information on it to save my life. When my user clicks or tabs into a textbox, I want to select (highlight) all of the text in the textbox so that if they start typing, it delete what is in the textbox and put in what they are typing. Anyone have any ideas? Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
*Experts* DiverDan Posted March 8, 2005 *Experts* Posted March 8, 2005 You'll need to set the textbox to the active control when it is entered either by the mouse or tabed. Private Sub TextBox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles _ TextBox1.Enter, TextBox1.MouseEnter Me.ActiveControl = Me.TextBox1 End Sub I think that should get the result you're looking for. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
RobEmDee Posted March 8, 2005 Posted March 8, 2005 The SelectAll() method of the TextBox will get the specific job done also. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.