472,139 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 software developers and data experts.

Questions about the focus of textbox

Hi all,

I am trying to customize the text box to suit the
practice of my app. And I am working about the focus
behavior of text field.

I have met the the following problem. When I set
the "tabstop" property of a textbox to "False", the
textbox does receive focus when user use the mouse to
click. However, if I set the "Enable" property to false,
the forecolor of the text will change to grey. Is there
any method that I can prevent the textbox getting the
focus neither by "Tab" key nor "Mouse" click?

Thanks for your attention.

Rgs,
Albinas
Jul 21 '05 #1
4 1747
What about using a label with its border and backcolor changed so that it
looks like a textbox?
"Albinas" <an*******@discussions.microsoft.com> wrote in message
news:48****************************@phx.gbl...
Hi all,

I am trying to customize the text box to suit the
practice of my app. And I am working about the focus
behavior of text field.

I have met the the following problem. When I set
the "tabstop" property of a textbox to "False", the
textbox does receive focus when user use the mouse to
click. However, if I set the "Enable" property to false,
the forecolor of the text will change to grey. Is there
any method that I can prevent the textbox getting the
focus neither by "Tab" key nor "Mouse" click?

Thanks for your attention.

Rgs,
Albinas

Jul 21 '05 #2
Hi all,

Thanks scott. But the field really needs input
function under some situations. Actually, we are trying
to divide the window form into read mode, insert mode,
update mode and etc. And textbox in each mode will be
given different setting of "ReadOnly", "TabStop", "Enable"
and "Visible".

For example, some fields will be editable during insert
mode while some will be invisible (autorun number with
user's defined format key) But that key will
become "visible Only" when the form is under "browse mode".

Your suggestion is actually my last sort of work-around.

Is there any other suggestion?

Rgs,
Albinas
-----Original Message-----
What about using a label with its border and backcolor changed so that itlooks like a textbox?
"Albinas" <an*******@discussions.microsoft.com> wrote in messagenews:48****************************@phx.gbl...
Hi all,

I am trying to customize the text box to suit the
practice of my app. And I am working about the focus
behavior of text field.

I have met the the following problem. When I set
the "tabstop" property of a textbox to "False", the
textbox does receive focus when user use the mouse to
click. However, if I set the "Enable" property to false, the forecolor of the text will change to grey. Is there
any method that I can prevent the textbox getting the
focus neither by "Tab" key nor "Mouse" click?

Thanks for your attention.

Rgs,
Albinas

.

Jul 21 '05 #3
I believe that there is also a Locked property for a text
box, this might help you although I am not sure about
whether the control can receive focus.
-----Original Message-----
Hi all,

Thanks scott. But the field really needs input
function under some situations. Actually, we are trying
to divide the window form into read mode, insert mode,
update mode and etc. And textbox in each mode will be
given different setting of "ReadOnly", "TabStop", "Enable"and "Visible".

For example, some fields will be editable during insertmode while some will be invisible (autorun number with
user's defined format key) But that key will
become "visible Only" when the form is under "browse mode".
Your suggestion is actually my last sort of work- around.
Is there any other suggestion?

Rgs,
Albinas
-----Original Message-----
What about using a label with its border and backcolor

changed so that it
looks like a textbox?
"Albinas" <an*******@discussions.microsoft.com> wrote in

message
news:48****************************@phx.gbl...
Hi all,

I am trying to customize the text box to suit the
practice of my app. And I am working about the focus
behavior of text field.

I have met the the following problem. When I set
the "tabstop" property of a textbox to "False", the
textbox does receive focus when user use the mouse to
click. However, if I set the "Enable" property tofalse, the forecolor of the text will change to grey. Is there any method that I can prevent the textbox getting the
focus neither by "Tab" key nor "Mouse" click?

Thanks for your attention.

Rgs,
Albinas

.

.

Jul 21 '05 #4
Locked will still receive focus.

You may want to consider using a label (as I described earlier) for your
read mode and a textbox for your insert and update modes.
"Mark" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
I believe that there is also a Locked property for a text
box, this might help you although I am not sure about
whether the control can receive focus.
-----Original Message-----
Hi all,

Thanks scott. But the field really needs input
function under some situations. Actually, we are trying
to divide the window form into read mode, insert mode,
update mode and etc. And textbox in each mode will be
given different setting

of "ReadOnly", "TabStop", "Enable"
and "Visible".

For example, some fields will be editable during

insert
mode while some will be invisible (autorun number with
user's defined format key) But that key will
become "visible Only" when the form is under "browse

mode".

Your suggestion is actually my last sort of work-

around.

Is there any other suggestion?

Rgs,
Albinas
-----Original Message-----
What about using a label with its border and backcolor

changed so that it
looks like a textbox?
"Albinas" <an*******@discussions.microsoft.com> wrote in

message
news:48****************************@phx.gbl...
Hi all,

I am trying to customize the text box to suit the
practice of my app. And I am working about the focus
behavior of text field.

I have met the the following problem. When I set
the "tabstop" property of a textbox to "False", the
textbox does receive focus when user use the mouse to
click. However, if I set the "Enable" property to

false,
the forecolor of the text will change to grey. Is there any method that I can prevent the textbox getting the
focus neither by "Tab" key nor "Mouse" click?

Thanks for your attention.

Rgs,
Albinas
.

.

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Neil Ginsberg | last post: by
4 posts views Thread by Sccr18 | last post: by
5 posts views Thread by Tosch | last post: by
8 posts views Thread by Albinas | last post: by
3 posts views Thread by Henry Jones | last post: by
3 posts views Thread by hugo | last post: by
3 posts views Thread by jp2express | last post: by

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.