473,395 Members | 1,678 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,395 software developers and data experts.

.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 1494
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*********@discussions.microsoft.com> wrote in message
news:91**********************************@microsof t.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_Validated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtServer.Validated
If txtServer.Modified Then
txtServer.Modified = False
ra = New RegistryAccess
ra.PutKey(ra.RegistryKeys.DatabaseServer, 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*********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.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_Validated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtServer.Validated If txtServer.Modified Then
txtServer.Modified = False
ra = New RegistryAccess
ra.PutKey(ra.RegistryKeys.DatabaseServer, 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*********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.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_Validated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtServer.Validated If txtServer.Modified Then
txtServer.Modified = False
ra = New RegistryAccess
ra.PutKey(ra.RegistryKeys.DatabaseServer, 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
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...
9
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,...
11
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...
14
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...
5
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...
3
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...
5
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...
2
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...
2
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...
0
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. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
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...

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.