Avatar of Saqib Husain
Saqib Husain
Flag for Pakistan asked on

VB.net selecting text inside textbox through code

In Visual Studio 2019 I am trying to select the text in a textbox programmatically. But neither intellisense gives the option of selectionstart or selectionlength nor can I see it in the properties pane. Even if I type it out manually it gives an error.

In the object browser the only items show for selectionstart are shown. Textbox is not part of it.
selectionstart.PNG
How can I select the text inside the textbox programatically?
Visual Basic.NETMicrosoft Visual Studio

Avatar of undefined
Last Comment
Scott McDaniel (EE MVE )

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Saqib Husain

ASKER
That is not working. The intellisense for txName does not give the option for selectionstart or selectionlength.
Saqib Husain

ASKER
Oops. I was working on the wrong variable. That was not a textbox. It was a label.

Sorry for the confusion.
Scott McDaniel (EE MVE )

Right - labels don't have those properties.
Your help has saved me hundreds of hours of internet surfing.
fblack61