Link to home
Start Free TrialLog in
Avatar of Saqib Husain
Saqib HusainFlag 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.
User generated image
How can I select the text inside the textbox programatically?
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Saqib Husain

ASKER

That is not working. The intellisense for txName does not give the option for selectionstart or selectionlength.
Oops. I was working on the wrong variable. That was not a textbox. It was a label.

Sorry for the confusion.
Right - labels don't have those properties.