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
  • 2
LVL 13

Accepted Solution

BlackTigerX earned 250 total points
Comment Utility
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
Comment Utility
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

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now