473,385 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

wanting the VB6 GotFocus event

This seems like it ought to be a simple thing. I am long accustomed to
using the GotFocus event in VB6 to select the text in a textbox when the
control is clicked in or tabbed into.

C# doesn't seem to have an event named GotFocus, so I tried the Enter event
(with SelectAll method). That works for tabbing into, but not clicking. So
I added the MouseDown event. That works half-way: click once and the text
is selected (good); click again and text is again selected (bad).

My desired behavior is this: the user clicks into the box, it selects the
text; without losing the focus on the control, the user clicks again and it
inserts the cursor into the text (nothing is selected).

I am a newbie, so am I missing something obvious? Do I need to override
some method?

Thanks.
Nov 15 '05 #1
0 1229

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Krisa | last post by:
Hello all, I just discovered something (stop me if you've heard this before....) that was causing me a significant performance hit when opening a form with subforms. To speed up loading the...
6
by: lauren quantrell | last post by:
I have a combo box on a form. It uses the GotFocus event to poopulate the rowsource with a value list that is created on the fly in VBA. Fine and dandy, except, is a user opens another form and...
2
by: Gopal Krishna Tengli | last post by:
Hi, I want to impliment the textbox's gotfocus event. Its not a intrincic event. So not listed in the editor. Waiting for an innovative reply... Gopal Krishna
1
by: moondaddy | last post by:
I have a c# 3.5 wpf app which uses user controls for data entry screens. These data entry screens can be nested inside of each. We can also have several ones open side by side at the same time. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.