473,511 Members | 15,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update the value property of a textbox without losing the focus?

13 New Member
Hi, I'm creating a "Filter-as-you-type" feature.
The problem is: when a textbox is being keyed in, only the Text property changes but the Value property, which I want to use, doesn't.
The only solution I found is to set the focus to another control and hence causes the update.
However, if I use this method, The function will end with the text in the box I have just typed in highlighted.
Then you will see that this is not much of the "Filter-as-you-type" I hoped because the user have to press 'end button' in order to continue his typing.

Any ideas? thanks,
Billiska
Sep 2 '08 #1
2 4522
Billiska
13 New Member
To: Whoever read this thread.

I have figured it out.
I just check if one of the controls has the focus when the filtering has to be performed. Then just write obj.value = obj.text if it is a textbox (if instead it is a combobox, this might a little bit more compolicated.)

However, the text inside the search box will still be highlighted anyway because of requerying or whatever.
This can be solved by putting the search boxes on a main form and using a subform to display the records. Hence, only the subform need to be requeried.

...If anybody has a better way to do this, let's share it. thanks
Sep 2 '08 #2
FishVal
2,653 Recognized Expert Specialist
Hello, Billiska.
  • What is wrong with retrieving textbox content via Text property, why do you need TextBox.Value to be changed?
  • You may use TextBox.SelStart and TextBox.SelLength properties to manipulate TextBox current selection and/or cursor position.

Regards,
Fish
Sep 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4741
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
17
2714
by: Zvi Danovich | last post by:
Hi, I am a newby in ASP.NET, and till now wrote only simple "classic" WEB-sites. But - the time came, and now I need that: 1. Server will "listen" for some events on its local machine 2....
4
2133
by: Jonathan Upright | last post by:
Greetings to anyone who can help: I'm using WebMatrix to make ASP.NET pages, and I chose the "Editable DataGrid" at the project selector screen. As you may know, it defaults to the Microsoft...
6
2382
by: Frank | last post by:
Hopefully this is the correct group for this message. My previous post to (I assume) a non-.net group was not welcomed. I have a form with 7 text boxes that are all bound to fields of a...
4
1420
by: Lenster | last post by:
Hi I'm using bound controls on a windows form such as textboxes, checkboxes etc. which work fine except for one thing... If you click on a checkbox for example its value changes visibly and...
6
3050
by: Dugo | last post by:
I'm trying to use a "keypad" form (with command buttons for numbers 0 thru 9) I developed to allow users to first click a textbox on one form, then click a number on the keypad and have the value...
2
8463
by: rn5a | last post by:
The different Validation controls like RequiredFieldValidator, RangeValidator etc. have a property named Display. This property can have 3 values - Dynamic, Static & None. What's the difference...
0
1394
by: Redback | last post by:
Im using VS 2005. I have a form with a tab control. I have text boxes which are bound to a binding source, which is bound to a dataset. I have a button on the form that allows the user to add...
0
1504
by: ranjithpanakal | last post by:
I am using a gridview and a textbox in an update panel. My aim is to search and display the items in the gridview based on the value in textbox. When a string is entered into textbox , it searches...
0
7252
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,...
0
7371
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,...
1
7093
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
7517
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
5676
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,...
0
4743
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...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
452
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...

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.