Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2006-06-17
Medium Priority
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 1000 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 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…
Suggested Courses

704 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