How can I change the focused control on welcome page? It is currently focused on NextButton
. But I need to change it to CancelButton
(or even any other buttons which I have added them programmatically like an About Button)
I tried this on InitializeWizard
event:
WizardForm.ActiveControl := CancelButton;
CancelButton.Default := true;
but no success. Even I tried something described here: http://www.delphigroups.info/2/f3/324879.html
SendMessage(Handle, WM_NEXTDLGCTL, 0, 0 );
and No success.
so how to solve this issue?
Changing wizard's ActiveControl
in InitializeWizard
is too early. It will get changed afterwards to the Next button.
Do it in the CurPageChanged(wpWelcome)
:
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpWelcome then
WizardForm.ActiveControl := WizardForm.CancelButton;
end;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.