Solved

Is there an easy way to enable the Ctrl-A key to work in a VB.NET text box?

Posted on 2004-08-15
2
195 Views
Last Modified: 2008-02-01
I want to be able to select all text within a text box in VB.NET.  CTRL-A does not work by default. Is there a simple way to enable it?
0
Comment
Question by:fowlow
2 Comments
 
LVL 19

Accepted Solution

by:
drichards earned 125 total points
Comment Utility
You can add this to your form (don't know if there's an easier way):

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If (e.KeyChar = Microsoft.VisualBasic.Chr(1)) Then
            TextBox1.SelectAll()
            e.Handled = True
        End If
    End Sub
0
 

Author Comment

by:fowlow
Comment Utility
Great answer.
Worked nicely.

Tim
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

9 Experts available now in Live!

Get 1:1 Help Now