your solution partly works.
I've already done a fix in 1.5 that does not need the Handle. I might merge it to 1.4.
But if i do no set LeftChar, LeftChar has a Value other than 1. But it never get changed by me. In my "real" application your solution with HandleNeeded has no effect. Also the position of setting TopLine makes no difference.
I've randomly seen this behaviour also in the IDE (after starting). What makes me wonder is that it works as intended for the first created SynEdit. If i put the SynEdits on different panels everyhing works okay.
If you do not set LeftChar this may be intended behaviour. may be ....
Here is what happens:
* CaretXY := ...
same for just CaretX, or CaretY, or anything that moves the caret (CaretXY := does not need to move the caret it always acts)
This will scroll SynEdit, so the caret is visible. So if you do not set LeftChar, then SynEdit may get scrolled.
* The first verses the other SynEdits.
The first is immediately visible, it has its Handle, and it gets its final Size. That is the difference.
As I explained; No Handle => SynEdit does not know its Size (Not a problem in SynEdit, Depending on a variety of things this can happen to any component)
Therefore SynEdit defers the scroll to when it gets a Handle.
-----------------------------------------------------
Now the question is:
At the time, you make any of the 2ndary SynEdits visible, can the caret be visible without scrolling.
If SynEdit Scrolls, even though the caret could have been seen on the screen without the scroll => then there is a bug.
-----------------------
Again I need OS and widgetset.
It Might be that for some reason the widgetset, defers the setting of the correct size. Then SynEdit will act on the wrong size.