473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 1842
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Neil Ginsberg | last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a form with a subform (in continuous form view). A combo box on the main form has code in the AfterUpdate event which adds a...
4
by: Sccr18 | last post by:
I just have a couple of easy questions: 1. In Asp.net using Vb is there a way to list all the possible characters without listing them all like Char() = "abc..."? 2. I was trying to set the focus...
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
1
by: TBK | last post by:
I'm trying to finish up an assignment I had for a class and basically I'm stuck. The program is supposed to take information you've entered, put it into an array, display it in a listbox and then...
5
by: Tosch | last post by:
I have a usercontrol with a label, a textbox, a treeview, a grid and a couple of checkboxes. The usercontrol is hosted on a form together with a cancel and a accept button. This form is used to...
8
by: Albinas | last post by:
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...
3
by: Henry Jones | last post by:
VS 2005 On a form I have a tabcontrol with 5 tabs. Each tab has three textboxes on it. When I click on each tab, I would like to have the focus set to the first textbox. On the tabenter...
3
by: hugo | last post by:
Hi, I have a function that I call from form fields using the OnKeyUp function to replace special caracters. Once this function has been called, it does not set the focus on the form field where...
3
by: jp2express | last post by:
I have several applications that use panels as screens, but I can *not* seem to set the focus for a Textbox. Panel1.BringToFront() Panel1_Textbox.Focus() ' do something with a control on Panel1...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.