Your problem is a bit confusing.

Anyway you probably have loaded the data somewhere in memory before
displaying it in TextBox. For example in DataTable. So whenever you do
saving you should check the TextBox value with that previously loaded value
in order to detect changes.

By the way this is NOT a good practice to again change text (of same
TextBox) in the TextChanged event handler it may produce infinite iteration.


On Sun, Jan 10, 2010 at 9:51 PM, 50cal <[email protected]> wrote:

> Hi All,
>
> I am creating a very basic contact manager to get me started
> developing in C#, I have created the form and a class call classfield
> that builds a text box and stores all the relevant information, such
> as the name and text etc.
> The field is then added to the form. I can navigate dummy records and
> load the relevant data into the field but I am not sure how to detect
> a text change to right the data back to the database.
>
> I though I could just add a text changed event to the class (like
> below) but it does not appear to be working.
>
>        public void mytextbox_TextChanged(object sender, EventArgs e)
>        {
>            MessageBox.Show("mytextbox changed");
>            mytextbox.Text = "TESTING!!!";
>        }
>
>
> Any advice would be appreciated!!
>
> Thanks,
> 50Cal.
>

Reply via email to