How do I updating Save state

  • Thread starter Thread starter TEK
  • Start date Start date
T

TEK

Hello

I'm programming with forms against a domain model, mainly using databinding
to connect my business objects to my form controls.

The domain object know when stuff has changed, so whenever the user moves
out of a edited field, the model is marked as modified and I can use that to
for example update the enabled/disabled state of the save menu item.

However, the user mostly feel that it's natural that the save button is
enabled at the moment he types any character into a field, or do any other
changes. Long before the databinding updates the value in the model.

How do you typically solve this issue?

TEK
 
I usually create a proc that is then called from any
edited control:
' _loading variable is set to True during setting the
controls' values from the database
Private _loading As Boolean = False
....
Private Sub control_ValueChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles txt1.TextChanged,
lst1.SelectedIndexChanged, chk1.CheckedChecked ' and so on
If Not _loading Then
btnSave.Enabled = True
End If
End Sub

HTH.

Please let me know if you need C# version of the code.
 
Am Mon, 28 Feb 2005 00:05:48 +0100 schrieb TEK:
Hello

I'm programming with forms against a domain model, mainly using databinding
to connect my business objects to my form controls.

The domain object know when stuff has changed, so whenever the user moves
out of a edited field, the model is marked as modified and I can use that to
for example update the enabled/disabled state of the save menu item.

However, the user mostly feel that it's natural that the save button is
enabled at the moment he types any character into a field, or do any other
changes. Long before the databinding updates the value in the model.

How do you typically solve this issue?

TEK

Seems like you'll have to use the TextChanged event....

Regards,
Munir Husseini
 
Back
Top