C# auto highlight text in a textbox control

Total Post:101

Points:709

C# 
C#
 2086  View(s)
Ratings:
Rate this:
How do you auto highlight text in a textbox control when the control gains focus?
  1. Re: C# auto highlight text in a textbox control

    Hi Pravesh,

    In Windows Forms and WPF:

    textbox.SelectionStart = 0;

    textbox.SelectionLength = textbox.Text.Length;

    Hope this will solve your problem.

      Modified On Apr-03-2018 05:46:28 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.