Strange problem with TCEFWindowParent
Posted: Tue Sep 22, 2020 4:13 pm
i have written a VCL application with a form in which i have TChromium component and TCEFWindowParent. I have exactly copied all procedures and events fromthe SimpleBrowser2 demo and all works well except for a strange behaviour when the application starts.
The form is designed with
Position := poScreenCenter
WindowState := wsNormal
The TCEFWindowParent is placed in a Panel aligned to the Form, but the size of TCEFWindowParent at design time is NOT aligned to the father panel and has a specific size (just for my decision).
Once the application is started i add the following two lines of code in the FormShow function:
crmWindow.Align := alClient; // crmWindow is TCEFWindowParent component
crmWindow.Visible := true;
FrmPortale.WindowState := wsMaximized; //FrmPortale is the form
At this point the form is showed on the screen and it appears maximized, but the TCEFWindowParent has the strange behaviour you may see in the attached image. A blank screen is showed aligned to the form, but the requested page is showed in a corner.
If i minimize the application and maximize it again the page is showed correctly.
The behaviour doesn't change if at design time i place the TCEFWindowParent aligned to the father panel/form already.
Do you have idea the reason for this behaviour ?
The form is designed with
Position := poScreenCenter
WindowState := wsNormal
The TCEFWindowParent is placed in a Panel aligned to the Form, but the size of TCEFWindowParent at design time is NOT aligned to the father panel and has a specific size (just for my decision).
Once the application is started i add the following two lines of code in the FormShow function:
crmWindow.Align := alClient; // crmWindow is TCEFWindowParent component
crmWindow.Visible := true;
FrmPortale.WindowState := wsMaximized; //FrmPortale is the form
At this point the form is showed on the screen and it appears maximized, but the TCEFWindowParent has the strange behaviour you may see in the attached image. A blank screen is showed aligned to the form, but the requested page is showed in a corner.
If i minimize the application and maximize it again the page is showed correctly.
The behaviour doesn't change if at design time i place the TCEFWindowParent aligned to the father panel/form already.
Do you have idea the reason for this behaviour ?