473,322 Members | 1,690 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,322 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 1492
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.