Ron_de_Weijze
asked on
OnExit special processing when switching between forms
Hello expert!
From the VCL reference help:
"Use the OnExit event handler to provide special processing when the control ceases to be active.
The OnExit event does not occur when switching between forms or between another application and your application."
What I need is this special processing when switching between forms.
The FormDeactivate event notices the switch, but what method evokes the OnExit special processing? I need it to save text in a RichEdit that disappears when switching forms. When I use the tab-key to jump (change focus?) from the RichEdit to a different control first and then switch forms, the text does not get lost.
I do not want to use a file and a button, only want to keep the text in the RichEdit as if the tab-key was hit just before the switch.
Any ideas?
Thanks
Ron dW
From the VCL reference help:
"Use the OnExit event handler to provide special processing when the control ceases to be active.
The OnExit event does not occur when switching between forms or between another application and your application."
What I need is this special processing when switching between forms.
The FormDeactivate event notices the switch, but what method evokes the OnExit special processing? I need it to save text in a RichEdit that disappears when switching forms. When I use the tab-key to jump (change focus?) from the RichEdit to a different control first and then switch forms, the text does not get lost.
I do not want to use a file and a button, only want to keep the text in the RichEdit as if the tab-key was hit just before the switch.
Any ideas?
Thanks
Ron dW
ASKER
Thanks TheRealLoki,
Now I can get to the OnExit event, but which call(s) save the text that is in the RichEdit and that is only kept (automatically) if the tab-key is hit?
Now I can get to the OnExit event, but which call(s) save the text that is in the RichEdit and that is only kept (automatically) if the tab-key is hit?
ASKER
Again, in other words:
Hitting the tab-key after text was put into the RichEdit, moves the cursor to the next control on the same form, thereby processing the text in the RichEdit somehow automatically, so that it does *not* get lost after the form is left, by clicking on another form on the screen. The events, FormDeactivate and RichEdit1OnExit, can be trapped to put in the right code but what is that code that preserves the text in the RichEdit and that is executed when tabbing from the RichEdit to the next control on the form, but that is not executed when clicking on a different form without explicit saving?
Hitting the tab-key after text was put into the RichEdit, moves the cursor to the next control on the same form, thereby processing the text in the RichEdit somehow automatically, so that it does *not* get lost after the form is left, by clicking on another form on the screen. The events, FormDeactivate and RichEdit1OnExit, can be trapped to put in the right code but what is that code that preserves the text in the RichEdit and that is executed when tabbing from the RichEdit to the next control on the form, but that is not executed when clicking on a different form without explicit saving?
ASKER
Apparently no-one knows, or I did not phrase the question well enough. (Or I am just plain stupid.)
This ticket can be closed. I will try again later with a new one, when I hit the same problem again.
Ron dW
This ticket can be closed. I will try again later with a new one, when I hit the same problem again.
Ron dW
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Loki,
Sorry for responding so late. I need to find time to get back to the situation. ASAP.
Regards,
Ron dW
Sorry for responding so late. I need to find time to get back to the situation. ASAP.
Regards,
Ron dW
e.g.
procedure TForm1.FormDeactivate(Send
begin
Form1.RichEdit1OnExit(Form
end;