How to create a delphi form containing multiple 'child' forms that can be moved/sized and show activated

后端 未结 3 1674
死守一世寂寞
死守一世寂寞 2020-12-19 17:32

I\'ve created a form that hosts one or more \'child\' forms. In my edit mode, each child form shows its border and caption bar allowing it to be moved and sized (a bit like

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-19 17:55

    Call Windows.SetFocus(Form.Handle) which is somewhat more forceful than TForm.SetFocus. Specifically Windows.SetFocus will focus and activate a form that is inactive which I suspect is your main problem.

    Having more than one form active feels wrong.

    Finally, did you consider using MDI? It still works.

提交回复
热议问题