473,385 Members | 1,492 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.

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 31908
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...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.