Form1.ActiveControl := SynEdit1;
And I now read that onPaint is a bad place for setting focus as it triggers often, so I moved it to onShow.
No idea what ActiveControl is