Form is switched in maximized/normal state on pressing SPACE. But...
When Form is created, Edit1 component has Focus (for some purposes). So, pressing SPACE actually change Form state, but "collateral damage" is that Edit1.Text Property is also changed.
I try this:
but without result.
Any idea how to prevent Edit1.Text Property to be changed?
When Form is created, Edit1 component has Focus (for some purposes). So, pressing SPACE actually change Form state, but "collateral damage" is that Edit1.Text Property is also changed.
I try this:
Code:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_SPACE then
begin
if self.WindowState = wsNormal then
self.WindowState := wsMaximized
else
self.WindowState := wsNormal;
Key := VK_LEFT; {doesn't works!?}
// Edit1.Clear; {this also doesn't works!}
end;
end;
but without result.
Any idea how to prevent Edit1.Text Property to be changed?