By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,454 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Form Focus

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.