Reputation: 319
I have a form with a VirtualStringTree (VST) and a TButton with its default property set to true
. The nodes of the VST contain inplace editors (TEdits). The problem is that the button always fires when editing the VST. How can I keep the button as default but have it ignore the enter key when the VST is being edited?
Upvotes: 1
Views: 251
Reputation: 2755
As Rob says you may use VirtualTree events to temporary disable Button.Default
property.
For example :
In OnEditing event disable Default property
Button.Default := false;
In OnEdited and OnEditCancelled events restore Default property
Button.Default := true;
Upvotes: 1