Solved

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

Posted on 2006-06-17
6
467 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 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();
            }
0
 
LVL 3

Assisted Solution

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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