Perhaps using the validating event would be better for your case.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"James Daughtry" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Let's say that I have some data bound controls on a form. What I want
> to do is check for a dirty state on those controls for when the user
> actively changes a value and throw a message box prompting for
> confirmation. However, if I use the TextChanged event on a text box,
> for example, the message box will be thrown *any* time the text is
> changed, including databinding and navigating records even if the
> "state" isn't dirty according to my application.
>
> Now, for a text box I can grab the KeyPress event and assume that a
> change is made, but this isn't so simple for other controls like check
> boxes or numeric up downs.
>
> Is there a clean way of doing what I want without handling every event
> under creation and manually doing the kind of stuff that I would expect
> .NET to do for me? ;-)
>
> Thanks!
>