Re: Handlers for Form Changes

Tech-Archive recommends: Speed Up your PC by fixing your registry



Liz wrote:
[...]
This *does* work, but there is at least one shortcoming, which is that if the user changes a control and then undoes the change, I'm not detecting that ... also, I'm just wondering if there's a better, more straightforward way of handling the issue ... any other ideas out there?

Personally, I think the way you're doing it now is actually reasonably elegant. It's not uncommon at all for a UI to consider any change, even if it's eventually manually reversed by the user, to be considered a "change".

That said, it appears to me that you're only actually look at changes to text fields. So what you're really interested in is whether the text in the text field is the same.

It seems to me that this would not actually be difficult to implement. After all of the fields have been initialized, just add all of the values to a Dictionary<object, string> where the control reference is the key and the Text property value is the value.

Then when you are making the decision as to whether to prompt the user to discard their changes, run through all the controls again except this time compare the value in the dictionary with the current value.

If none of the text values are different, then you can safely suppress the prompt.

Pete
.



Relevant Pages

  • Re: DOS program runs slow in XP
    ... > I have a DOS based, Siebe DMS environmental control ... > using the C:\ Prompt program, ... > conditioning, fresh air intake, fan speeds, etc. ... > there is a clock in the program with seconds display. ...
    (microsoft.public.windowsxp.general)
  • DOS program runs slow in XP
    ... Siebe DMS environmental control ... using the C:\ Prompt program, ... conditioning, fresh air intake, fan speeds, etc. ... there is a clock in the program with seconds display. ...
    (microsoft.public.windowsxp.general)
  • Re: Unable to remove software from registry
    ... I tried to permit myself to have full control but was prompted "unable to ... save permission changes on settings." ... I am not able to remove software altnet and myway via registry ... I was prompt "cannot ...
    (microsoft.public.windowsxp.general)
  • Re: Download a file without prompt ?
    ... What you need is a control activeX or java applet to forces download without ... user prompt. ... But there is always a prompt box shows up on use's machine ...
    (microsoft.public.scripting.jscript)
  • Authentication problem?
    ... Our intranet site uses NT Authentication. ... unneccessary prompt. ... We had no problem with this control in Windows 2000. ... On all pages except those with the calendar control NT Authentication ...
    (microsoft.public.windows.server.active_directory)