Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Do you want to save changes? - monitor form for cliks or presses

cjpwoodcjpwood Member Posts: 2
Hi guys,

i wondered if anyone could help me. i want to add a function where if someone leaves my application and they have unsaved changes i can ask them if the want to save the changes...the message box etc is straight forward but is there a way to monitor the page for button clicks or keyboard presses (to determine if there has been changes...) if anyone could help on this i would be very great-full :)

best regards

Christina xxx

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : Hi guys,
    :
    : i wondered if anyone could help me. i want to add a function where
    : if someone leaves my application and they have unsaved changes i can
    : ask them if the want to save the changes...the message box etc is
    : straight forward but is there a way to monitor the page for button
    : clicks or keyboard presses (to determine if there has been
    : changes...) if anyone could help on this i would be very great-full
    : :)
    :
    : best regards
    :
    : Christina xxx
    :

    If it's your application, just add a member boolean bChangesSaved to the Form. Then, at load time set it to True, set it to False every time internal data has been changed and set it to True again after saving.

    If you have controls, you can also handle their event. TextBox_Change for instance. Whenever this event triggers, set bChangesSaved to False.

    Good luck

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • cjpwoodcjpwood Member Posts: 2
    : : Hi guys,
    : :
    : : i wondered if anyone could help me. i want to add a function where
    : : if someone leaves my application and they have unsaved changes i can
    : : ask them if the want to save the changes...the message box etc is
    : : straight forward but is there a way to monitor the page for button
    : : clicks or keyboard presses (to determine if there has been
    : : changes...) if anyone could help on this i would be very great-full
    : : :)
    : :
    : : best regards
    : :
    : : Christina xxx
    : :
    :
    : If it's your application, just add a member boolean bChangesSaved to
    : the Form. Then, at load time set it to True, set it to False every
    : time internal data has been changed and set it to True again after
    : saving.
    :
    : If you have controls, you can also handle their event.
    : TextBox_Change for instance. Whenever this event triggers, set
    : bChangesSaved to False.
    :
    : Good luck
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry

    Hi Richard,

    Thanks for that! v useful! is there anyway do do it for all items on the form at the same time??

    Regards

    Christina
    xx
  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444

    : Hi Richard,
    :
    : Thanks for that! v useful! is there anyway do do it for all items on
    : the form at the same time??
    :
    : Regards
    :
    : Christina
    : xx
    :

    That would be about the same as always prompting the user for save.
    The only exception would be if the user saves and then immediately exits.


    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.