Highlight text in textbox the same way the Firefox address bar on click

Posted on 2006-06-17
Last Modified: 2011-04-14
any ideas?
Question by:addicktz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 13

Accepted Solution

BlackTigerX earned 250 total points
ID: 16928096
on the form load

textBox1.Click+=new EventHandler(textBox1_Click);

then write the event method

            private void textBox1_Click(object sender, EventArgs e) {
                  (sender as TextBox).SelectAll();

Assisted Solution

mistaeverly earned 250 total points
ID: 16974374
Javascript is the way to go... posting back to the server is unnessary and seems pretty ungainly to me.

<asp:textbox id="mytestbox" runat="sever" onfocus=""></asp:textbox>

This should be the exact functionality you're looking for.

Expert Comment

ID: 17131364
Betweem BlackTiger and myself, we have given both a Server-side and Client-side solution.  I propose split points.

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question