How to 'parent' a form? (Controls won't accept focus)

后端 未结 1 1221
南旧
南旧 2020-12-21 07:07

I have a child form \'frmTest\' and a main form \'TfrmMain\'. I set the main form as parent for frmTest like this:

unit Main;

INTERFACE
USES
  System.SysUti         


        
相关标签:
1条回答
  • 2020-12-21 07:51

    I suggest that you set BorderStyle to bsNone for the child form. I'm not sure of the exact reasons why this works, but it has the desired effect.

    If you need to add a visual frame for your child form then that is best done with explicit UI for the contained of your child form.

    Forms aren't really intended to be used in this way, in my opinion. You can make things mostly work, but it's not terribly robust. Putting the UI into a frame and then hosting that should lead to better behaviour.

    0 讨论(0)
提交回复
热议问题