'TValueListEditor - how to validate input?

I have a TValueListEditor and want to validate input. For example replace all spaces to underscores.

How to do that? I thought OnSetEditText might be good but I can't change Value there.



Solution 1:[1]

This seems to work for me

procedure TForm1.ValueListEditor1GetEditText(Sender: TObject; ACol,
  ARow: Integer; var Value: string);
begin
  CurrentRow := ARow;
end;

procedure TForm1.ValueListEditor1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if CurrentRow <> 3 then Exit;

  if Key = 32 then Key := 0;
end;   

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tom