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

x
?
Solved

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

Posted on 2006-06-17
6
Medium Priority
?
469 Views
Last Modified: 2011-04-14
any ideas?
0
Comment
Question by:addicktz
[X]
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
6 Comments
 
LVL 13

Accepted Solution

by:
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();
            }
0
 
LVL 3

Assisted Solution

by:mistaeverly
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.
Try:

<asp:textbox id="mytestbox" runat="sever" onfocus="this.select()"></asp:textbox>

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

Expert Comment

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

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 : http://www.videocopilot.net/presets/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