Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-06-17
6
Medium Priority
?
470 Views
Last Modified: 2011-04-14
any ideas?
0
Comment
Question by:addicktz
  • 2
3 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

Technology Partners: 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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

876 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