MaxValue: Integer;
MaxValue: Integer;
The MaxValue property determines value of the MAXVAL parameter in binding string.
The MAXVAL parameter determines maximum available value, which can be set in editor.
The MaxValue property is available if the MaxValueDefined property is set to True. If the MaxValue property is changed, the MaxValueDefined property is automatically set to True.
Function CreateIntegerEditBidning(DefaultValue: Integer): String;
Var
BM: IBindingManager;
IntegerEditBinding: IBindingIntegerEdit;
Begin
BM := New BindingManager.Create;
IntegerEditBinding := BM.CreateByUi("IntegerEdit") As IBindingIntegerEdit;
IntegerEditBinding.Mandatory := True;
IntegerEditBinding.CorrectOnExit := True;
IntegerEditBinding.MinValue := DefaultValue - 100;
IntegerEditBinding.MaxValue := DefaultValue + 100;
IntegerEditBinding.Value := DefaultValue;
IntegerEditBinding.MaxLength := 3;
Return IntegerEditBinding.AsString;
End Function CreateIntegerEditBidning;
This function generates binding string to use editor of integer values. The value, towards which editor parameters are determined, is passed by the DefaultValue input parameter. When invalid value is input to the cell with editor (greater than maximum value or less than minimum value) and focus is taken off from the cell, the editor value will be replaced with the nearest available. The limit of input character number set for the editor is three.
Imports Prognoz.Platform.Interop.ForeSystem;
Function CreateIntegerEditBidning(DefaultValue: Integer): String;
Var
BM: BindingManager = New BindingManagerClass();
IntegerEditBinding: IBindingIntegerEdit;
Begin
IntegerEditBinding := BM.CreateByUi("IntegerEdit") As IBindingIntegerEdit;
IntegerEditBinding.CorrectOnExit := True;
IntegerEditBinding.MinValue := DefaultValue - 100;
IntegerEditBinding.MaxValue := DefaultValue + 100;
IntegerEditBinding.Value := DefaultValue;
IntegerEditBinding.MaxLength := 3;
Return IntegerEditBinding.AsString;
End Function;
The result of executing the example is similar to the Fore example result.
See also: