473,839 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1904
What about using a label with its border and backcolor changed so that it
looks like a textbox?
"Albinas" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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
3873
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 record to the subform (based on the value of the combo box) and requeries the subform control. I want the focus to return to the combo box on the main form when it's done, but I can't get it to do so if the user enters a value and presses Enter...
4
1199
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 to a text and was not able to by using txtEmp.setfocus(). I read somewhere that this may not be possible, is that true? 3. When you sign on to my web page that I am making and go to type something into the textboxes, dropdown boxes with...
4
3954
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 textboxes and a checkbox. The behaviour I want from my app is as follows:- When the textbox (which is prior in tab order to the tab control) has been filled with a certain length of text by the user, the focus is
1
1321
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 average the total of numbers. Right now I have 2 questions. How do I get numbers from my array that are put into the listbox into the 2 decimal format. I've tried all sorts of combinations and I can't get it to work. Second, I need to take the...
5
8737
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 search records in a database. On several forms in my application I show (modal) this form to search records. Everytime I show the form I want the focus to be on the textbox on the usercontrol. This works the first time I display the form. But...
8
284
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 "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,
3
6778
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 event for each tab, I put a textbox1.focus but the textbox doesn't contain the cursor. How can I do this?
3
4927
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 I have called the function from. What happens : I laod a EDIT page with a html form on it and fill in the fields with
3
5202
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 Panel2.BringToFront() Panel2_Textbox.Focus() ' do something with a control on Panel2
0
9855
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10647
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7828
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7017
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5866
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4484
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3133
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.