473,394 Members | 1,806 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,394 software developers and data experts.

Set focus to control on form when displayed

Tim
Hi,

How do I set the focus to a control (TextBox) on the form when it is
displayed. The text box is empty and I want the caret blinking in it.
It is not the first item in the tab order and I can't make it such.

So how do I do it? I thought this was relatively easy but I must be
having a mental block.

Tim
Nov 18 '05 #1
1 1904
Tim,

You can just call the Focus method on the control, and it will shift the
focus to that control.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tim" <ti**@peopletogo.com> wrote in message
news:vP*******************@news20.bellglobal.com.. .
Hi,

How do I set the focus to a control (TextBox) on the form when it is
displayed. The text box is empty and I want the caret blinking in it. It
is not the first item in the tab order and I can't make it such.

So how do I do it? I thought this was relatively easy but I must be having
a mental block.

Tim

Nov 18 '05 #2

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

Similar topics

2
by: Robert Nurse | last post by:
Hi All, I've got a strange problem in IE that I wonder if anyone has seen before. Basically, I've got a two window scenario. The parent window opens the child via window.open(). The child...
5
by: tshad | last post by:
I have a date validation function that I want to stay at the object I am validating if there is a Validation error, but it always goes to the next object. The Javascript: function...
5
by: Vinny Vin | last post by:
I would like to display a ToolTip (WinForms) when the Control associated recieves focus (when the control.enter event is triggered) as oppose to having the ToolTip displayed when the mouse hovers...
2
by: Mark Ingram | last post by:
Hi, ive just had to make a Find dialog for an application and to get it in a similar style to the MS ones i have had to set the control style to TopMost so that i can move the caret around...
0
by: Stephen Bedford | last post by:
I am developing an application that is primarily keyboard not mouse driven. Navigation is very difficult within some controls (list boxes, radio groups etc) unless the focus rectangle is visible. ...
0
by: SpotsPlay | last post by:
If I bind a TextBox to a property on a "BusinessObject", the first time that TextBox is edited (each time the form/user control is opened) hitting Tab or clicking on another control on the...
2
by: Marco Liedekerken | last post by:
Hi, Is it possible to retrieve the control that had the focus when the page was posted back? Because the focus is lost when a postback occurs I want to manually set the focus to the control...
2
by: Sridhar | last post by:
Hi, I have a question. I have created a user control which contains a textbox and a button. we will enter some search word in the textbox and hit the button. Then we will get a pop-up with the...
11
by: sheldonlg | last post by:
I have a problem with not seeing the current focus while in a particular screen in a my app. The focus does not show for a type=text or textarea. I have tried to reproduce this problem in a test...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.