• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

i have a textbox i do NOT want to have focus how do i do this with vb.net

i have a textbox that gets highlighted when the windows form is loaded how do i have it NOT highlighted nor focus at all.

thx
Johnny
aka Pern
0
Johnny
Asked:
Johnny
  • 3
  • 2
  • 2
2 Solutions
 
Bob LearnedCommented:
You could force the focus to a different control.

Bob
0
 
planoczCommented:
In your properties box of the textbox change TabStop = false.
0
 
Bob LearnedCommented:
That will only keep the text box from being part of the tab sequence, but not if clicked on with the mouse.

Bob
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
planoczCommented:
This is true. but he wanted to bypass it on the form Load.
But he could change the tab order so that it ends up being tabed last.
0
 
Bob LearnedCommented:
Aaah, yes, good point, at startup it is based on the tab order of the controls, so you could set the tab order correctly, so that the text box is not Tab Index 0.

Bob
0
 
JohnnyAuthor Commented:
i have a few textboxes on the form i do not want any of them focused...i have no other controls on the fiorm.

is there a way to make it so the form has focus. and no controls???

thx
0
 
JohnnyAuthor Commented:
i figured it out from what you all said..

i just made all the tab stops false and then made the last textbox tab index one number off last was 4 i made it 6 so it had a missing 5 for a tab stop and left that as focus..and it folled it into thinking it had a focus...

non of the textboxes have focus.

thx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now