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

How do you set focus to a control

HI
A very simple question. I like to set the focus to a TextBox when the forms opens. How do you do that in Vb.net
Thanks in Advance

Kelly Dykste

Nov 20 '05 #1
5 31892
jim
Hi Kelly,

in your forms load event...

\\\
TextBox1.Focus()
///

hope this helps,

jim
"Kelly Dykster" <an*******@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
HI,
A very simple question. I like to set the focus to a TextBox when the forms opens. How do you do that in Vb.net. Thanks in Advance.

Kelly Dykster

Nov 20 '05 #2
Thanks jim, but i have tried it and it desn't do what i like it to do. I want when the form opens the IBeam Cursor start at the textbox and texbox.focus doesn't do it for me.
Nov 20 '05 #3
* "jim" <james_matthews_at_shi_dotcom> scripsit:
in your forms load event...

\\\
TextBox1.Focus()
///


'Load' is executed before the form is shown, so no focus can be set.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet/>

..NET FAQs: <http://www.mvps.org/dotnet/dotnet/faqs/> (German)
Nov 20 '05 #4
* "=?Utf-8?B?S2VsbHkgRHlrc3Rlcg==?=" <an*******@discussions.microsoft.com> scripsit:
A very simple question. I like to set the focus to a TextBox when the forms opens. How do you do that in Vb.net.


Assign the control the lowest 'TabIndex' on the form.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet/>

..NET FAQs: <http://www.mvps.org/dotnet/dotnet/faqs/> (German)
Nov 20 '05 #5
Thanks for the great hint. That was my problem!
Nov 20 '05 #6

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

Similar topics

2
by: Karl Irvin | last post by:
In continous form is there a way to tell the name of the currently highlighted control and its value?
1
by: tlemcenvisit | last post by:
Hello I have a label such as : label1->text= “&method” and I have a textbox I want that the textbox receives the focus when the user press alt+m In borland C++ builder I did...
0
by: LCAdeveloper | last post by:
Another newbie question I'm afraid. When I use the .Focus() or .Select() methods to set the initial control that has focus on a form, try as I might I cannot get the control to visually indicate...
1
by: clickon | last post by:
For testing purposes i have got a 2 step WizardControl. Eqach step contains a text box, TextBox1 and TextBox2 respectively. If i put the following code in the respective activate event handlers for...
1
by: amjad | last post by:
Hi i need to write javascript to shift control focus ..... like if i enter in textbox 1 then it set focus to textbox2 or 3 any thing ... the other thing is how i know i can do like...
6
by: MSDN | last post by:
After a postback, how do I set focus onto a control that is inside an updatepanel?
4
by: Jon Slaughter | last post by:
I've created some custom controls and forms that allow the feature to temporarily transfer focus to a control that has been entered by the mouse. Everything seems to work fine but the problem I...
1
by: PerumalSamy | last post by:
I created javascript coding to focus on a Textbox during page load. After some process while refresing the page the control again focusing on same Textbox. How can i write coding in...
1
by: saumitra | last post by:
The problem is somthing like this... I have an Html-el Form. in which i am using Extreme component. I am using html:submit. now the problem is that I am not able to get the focus on this submit...
2
by: Luke Sayaw | last post by:
Hi, Does anyone have an idea of how to set focus to the first control after summary validation occurs. After clicking on the summary validation message box, the focus should be set to the first...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.