Form Focus

G

Guest

Hi,

I have a VB.NET form with a bunch of controls in it .
The focus is in one of the controls , (i.e. a textbox), is there any way to
click on the form itself and make the textbox lose focus and have the form
gain the focus ,
so that no control on the form has the focus ?

Thanks,
Hang
 
N

Newbie Coder

It sounds like the textbox is the defualt item & is highlighted still when
the form is clicked

Click VIEW menu TAB ORDER & change it there, but you won't be able to set
the form as tab order

The Textbox also has a boolean tabstop property which by default is set to
true

I hope that helps,
 
G

Guest

my problem is that i want all controls in my form to lose focus when a user
clicks on the form ...
does anybody know if that's possible ?

thanks,
 
N

Newbie Coder

If you click the form then all the controls will lose focus because the form
will have the focus
 
G

Guest

i tried that ... i thought the same thing but it doesn't work ... it works on
web pages but not on Windows form, or am i missing something ?
give it a try and see if you get the same thing ...
 
N

Newbie Coder

No, I don't get the same

If you use Outlook Express for posting messages then zip the project & add
to your post then it can be downloaded or just past the entire forms class
in here

Newbie Coder
 
N

Newbie Coder

Aha - nice one


Scott Lam said:
I got the answer from another board, in case somebody else runs into the same
problem, here is what I used:

in the Form_click event, add :
Form1.ActiveControl = nothing

Thanks for all your reponses,
hang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top