|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Tracking changes made to form...Just wondering if there is a good way to do this that won't take me
forever and a day. My form has many textboxes and comboboxes and radio buttons and checkboxes on it. I want to know if a user changes a value on any of those things...and if so, when they close the form, if they haven't saved, prompt them to do so. I can go into every textbox's TextChanged event and add this code: bChanges = True - however, this will take a LONG time...is there some neat special new .Net way of tracking if any data has changed on the form? Or do I have to add that line of code to every control? Matt Well,
Not sure about a great way, but seems you could loop through all textbox controls and AddHandler to add one handler to them all for TextChanged. That way you'd have one routine that handles text changes for all textboxes. HTH, Shane Show quoteHide quote "YYZ" <matt.da***@gmail.com> wrote in message news:1142437826.093326.98840@e56g2000cwe.googlegroups.com... > Just wondering if there is a good way to do this that won't take me > forever and a day. > > My form has many textboxes and comboboxes and radio buttons and > checkboxes on it. I want to know if a user changes a value on any of > those things...and if so, when they close the form, if they haven't > saved, prompt them to do so. > > I can go into every textbox's TextChanged event and add this code: > bChanges = True - however, this will take a LONG time...is there some > neat special new .Net way of tracking if any data has changed on the > form? Or do I have to add that line of code to every control? > > Matt > Great idea -- thanks for that. One quick question...will there be any
unintended consequences if I already HAVE a handler for a textbox, and then I add another for the changes thing? Matt "YYZ" <matt.da***@gmail.com> schrieb No.> Great idea -- thanks for that. One quick question...will there be > any unintended consequences if I already HAVE a handler for a > textbox, and then I add another for the changes thing? Armin > > Great idea -- thanks for that. One quick question...will there be Great! That sounds like a great solution, then. Now I'll do some time> > any unintended consequences if I already HAVE a handler for a > > textbox, and then I add another for the changes thing? > > No. testing on how it affects the performace to dynamically add those handlers at run time. Matt
Should I Use "Dim ___ As New ___"?
Open a Text File in Notepad using VB.Net 2005 [Help] Reading data from a DLL structure in C Playing System Sounds/WAV files Datetime arithmetic in VB.Net? KeyDown event MDI Parent/Child forms bindingsource what should i use? Different ways to go about storing data in an xml file.. |
|||||||||||||||||||||||