473,795 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.net textbox what is correct event to use.

When a user changes the text in a textbox i wish to update the registry key it represents. If I use event TextChanged event then as you type every character in your update the registry routines are called. If I use Validated Event then if you click on the text box or tab past it and not change the text the registry is refreshed. Is there an event that represents "I have changed this text and I have finished changing it now". (Apart from a button next to the text box "Update Registry" :-)
Jul 21 '05 #1
4 1567
Hi,
AFAIK, there is no such event in .net.
But there is a work around
Use both two events.
Have a dirty flag.
set the dirty flat to true during the TextChanged event.
In the Validated Event, check the dirty flag and call the update registry
method.

Regards,
R.Balaji

"Jarrod Sharp" <Ja*********@di scussions.micro soft.com> wrote in message
news:91******** *************** ***********@mic rosoft.com...
When a user changes the text in a textbox i wish to update the registry

key it represents. If I use event TextChanged event then as you type every
character in your update the registry routines are called. If I use
Validated Event then if you click on the text box or tab past it and not
change the text the registry is refreshed. Is there an event that
represents "I have changed this text and I have finished changing it now".
(Apart from a button next to the text box "Update Registry" :-)
Jul 21 '05 #2
i think the Modified property of the TextBox control is my solution (like the dirty flag suggested). you have to manually reset it. here is what i am using:

Private Sub txtServer_Valid ated(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles txtServer.Valid ated
If txtServer.Modif ied Then
txtServer.Modif ied = False
ra = New RegistryAccess
ra.PutKey(ra.Re gistryKeys.Data baseServer, txtServer.Text)
ra = Nothing
End If
End Sub

"Jarrod Sharp" wrote:
When a user changes the text in a textbox i wish to update the registry key it represents. If I use event TextChanged event then as you type every character in your update the registry routines are called. If I use Validated Event then if you click on the text box or tab past it and not change the text the registry is refreshed. Is there an event that represents "I have changed this text and I have finished changing it now". (Apart from a button next to the text box "Update Registry" :-)

Jul 21 '05 #3
Why don't you monitor the key press event and, for example, on Enter key you
save the value you want?

"Jarrod Sharp" <Ja*********@di scussions.micro soft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
i think the Modified property of the TextBox control is my solution (like the dirty flag suggested). you have to manually reset it. here is what i
am using:
Private Sub txtServer_Valid ated(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles txtServer.Valid ated If txtServer.Modif ied Then
txtServer.Modif ied = False
ra = New RegistryAccess
ra.PutKey(ra.Re gistryKeys.Data baseServer, txtServer.Text)
ra = Nothing
End If
End Sub

"Jarrod Sharp" wrote:
When a user changes the text in a textbox i wish to update the registry

key it represents. If I use event TextChanged event then as you type every
character in your update the registry routines are called. If I use
Validated Event then if you click on the text box or tab past it and not
change the text the registry is refreshed. Is there an event that
represents "I have changed this text and I have finished changing it now".
(Apart from a button next to the text box "Update Registry" :-)
Jul 21 '05 #4
Why don't you monitor the key press event and, for example, on Enter key you
save the value you want?

"Jarrod Sharp" <Ja*********@di scussions.micro soft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
i think the Modified property of the TextBox control is my solution (like the dirty flag suggested). you have to manually reset it. here is what i
am using:
Private Sub txtServer_Valid ated(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles txtServer.Valid ated If txtServer.Modif ied Then
txtServer.Modif ied = False
ra = New RegistryAccess
ra.PutKey(ra.Re gistryKeys.Data baseServer, txtServer.Text)
ra = Nothing
End If
End Sub

"Jarrod Sharp" wrote:
When a user changes the text in a textbox i wish to update the registry

key it represents. If I use event TextChanged event then as you type every
character in your update the registry routines are called. If I use
Validated Event then if you click on the text box or tab past it and not
change the text the registry is refreshed. Is there an event that
represents "I have changed this text and I have finished changing it now".
(Apart from a button next to the text box "Update Registry" :-)
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
4379
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I added a class to project and it's named XmlApi(). In the XmlAPI() class I have simple code as following XmlAPI() { string str = "Some Text";
9
10121
by: Jerry | last post by:
In limiting textbox input to 500 characters I would like to include a dynamic count of characters input while the user is typing into a textbox. This would obviously be a client side control, possibly a custom validator with a function written in javascript. Has anyone done this? Does someone have an example? Regards
11
7764
by: Joe | last post by:
Hello All, I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton (SearchButton) server controls. The user can type search text in SearchTextBox and click SearchButton and the web server performs a database query and displays the results. All of this works fine. I want the user to be able to press the Enter key while the cursor is still in SearchTextBox and have the SearchButton.Click event fire (thus performing...
14
14635
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user presses the "Save" button while the textbox has the focus, the LostFocus code doesn't run at the right time, so that the "Save" function is dealing with an incorrectly formatted string and the whole caboodle goes splat.
5
4817
by: ameen.abdullah | last post by:
Hi Guys, I have a textbox in windows form that should only accept alphabets, numbers, spaces and underscore. If the textbox contains anyother character it should display a msg at the time of validation.. Is there any funciton in vb.net for this? or any other way?? Waiting for ur replies...
3
5418
by: Patrick [MSFT] | last post by:
Let me preface this with the goal I'm trying to achieve is mimic a feature of another language (Dexterity used by Microsoft Dynamics) and so while a filling a drop down list is a workable solution I'd rather do it like Microsoft Dynamics does and use separate textbox and lookup button. What I have is, simply, is a C# winform, a textbox and a pushbutton. On the textbox, on the validating event of the textbox I check my customer table...
5
13963
by: Stuart Shay | last post by:
Hello All I am working on ASP.NET 1.1 Custom Pager that allows a User to Enter a Number in a TextBox and go to the page selected. Since the OnClick Event does not work in ASP.NET 1.1 for a TextBox I want to use a hidden button to fire when the Onclick Event is fired for the TextBox.
2
2124
by: rn5a | last post by:
A DataGrid displays 8 columns - ProductID, ProductName, Description, Price, Quantity, Sub-Total, Edit & Delete. *Edit* is a EditCommandColumn, *Delete* is a ButtonColumn & *Quantity* is a BoundColumn. If the *Edit* link is clicked, the *Quantity* column changes to the editable mode with a TextBox & the text under the *Edit* column of the corresponding row gets replaced by 2 hyperlinks - Update & Cancel. In order to ensure that the width...
2
13610
by: mc | last post by:
Can someone suggest how I would add a new trigger such that when the JS event onkeyup in a textbox the updatePanel refreshes? If not could someone sugest how I could onkepup in a Textbox, refresh the contents of a gridview/repeater control? TIA MC
0
2515
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. In this table there are multiple columns that cannot be NULL, which, are bound to other controls (but they're not really important at this time). I create a new row via the currency manager like so: _currencyManager.AddNew() _currentRow =...
0
9522
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,...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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
10002
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7543
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
6783
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
5437
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
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.