467,926 Members | 1,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,926 developers. It's quick & easy.

Form Focus

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
Dec 22 '06 #1
  • viewed: 2249
Share:
6 Replies
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,

"Scott Lam" <Sc******@discussions.microsoft.comwrote in message
news:F4**********************************@microsof t.com...
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

Dec 22 '06 #2
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,

"Newbie Coder" wrote:
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,

"Scott Lam" <Sc******@discussions.microsoft.comwrote in message
news:F4**********************************@microsof t.com...
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


Dec 22 '06 #3
If you click the form then all the controls will lose focus because the form
will have the focus
"Scott Lam" <Sc******@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
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,

"Newbie Coder" wrote:
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,

"Scott Lam" <Sc******@discussions.microsoft.comwrote in message
news:F4**********************************@microsof t.com...
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

Dec 22 '06 #4
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 ...


"Newbie Coder" wrote:
If you click the form then all the controls will lose focus because the form
will have the focus
"Scott Lam" <Sc******@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
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,

"Newbie Coder" wrote:
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,
>
"Scott Lam" <Sc******@discussions.microsoft.comwrote in message
news:F4**********************************@microsof t.com...
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
>
>
>


Dec 22 '06 #5
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
Dec 22 '06 #6
Aha - nice one
"Scott Lam" <Sc******@discussions.microsoft.comwrote in message
news:1E**********************************@microsof t.com...
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

"Newbie Coder" wrote:
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


Dec 22 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by JJ | last post: by
17 posts views Thread by Neil Ginsberg | last post: by
6 posts views Thread by Ekim | last post: by
2 posts views Thread by Sid Price | last post: by
2 posts views Thread by SONIQ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.