The event handler receives an argument of type System.EventArgs containing data related to this event.
The Modified event is raised immediately after the editor's BaseEdit.IsModified property was set to true. This occurs when first editing the value since the last validation. You can handle the event to indicate that the current value has not been validated/saved yet. Note: you should handle the Validating event to perform actions when the edit value is accepted (to reset the unsaved state indicator, for instance).

Example
The following sample code handles the Modified event of a MemoEdit control to make the toolBarSaveButton of the toolBar1 control enabled each time the end-user starts to change memo edit contents. The ButtonClick event is handled in order to validate the memo editor using the BaseEdit.DoValidate method and to perform specific actions in response to button click events (for example, you can save memo edit contents to a file). Once all necessary operations are performed, toolBarSaveButton is disabled.
C# |
using System.Windows.Forms;
using DevExpress.XtraEditors;
private void memoEdit1_Modified(object sender, System.EventArgs e) {
toolBarSaveButton.Enabled = true;
}
private void toolBar1_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
if (e.Button == toolBarSaveButton){
memoEdit1.DoValidate();
/*
*
* Here you can save the memoEdit1 contents or
* perform some other specific actions in response to button click
*/
e.Button.Enabled = false;
}
}
|
VB |
Imports DevExpress.XtraEditors
Private Sub MemoEdit1_Modified(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles MemoEdit1.Modified
toolBarSaveButton.Enabled = True
End Sub
Private Sub ToolBar1_ButtonClick(ByVal sender As Object, _
ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
If e.Button Is toolBarSaveButton Then
MemoEdit1.DoValidate()
e.Button.Enabled = False
End If
End Sub
|