<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Mon, Nov 29, 2021 at 1:32 PM Ondrej Pokorny via lazarus <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There are many scenarios when the Canvas cannot be accessed and it is a <br>
common mistake to access it when not allowed.<br>
<br>
I didn't study the issue further but to me it looks strange that setting <br>
some parameters in CreateParams helps with it. Juha, your commit <br>
description "Somehow fixes issue ..." doesn't help to understand your <br>
change either.<br></blockquote><div><br></div><div>The commit message is not perfect but the committed code is, now that I fully understand the issue.</div><div>CreateParams for Frame now follows the same logic as CreateParams for Form.<br></div><div>It allows a Frame to stand without a parent in the designer or even at runtime in some hypothetical situation(?).</div><div>Using Canvas outside Paint may not be recommended but it can be done in some widgetsets. The component's duty is to not crash in designer or anywhere else when it happens.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
So I would encourage the component author to rewrite his code.<br></blockquote><div><br></div><div>Rewrite? Ok, then TCustomForm must be rewritten, too. They now follow the same logic, at least regarding CreateParams().<br></div><div><br></div><div>Juha</div><div><br></div></div></div></div></div></div></div>