1

I'm trying to make some kind of pseudo-MDI interface using the following code:

FormChild := TFReference.Create(Application);
Winapi.Windows.SetParent(FormChild.Handle, MainForm.Handle);
FormChild.Show;

Everything works well, except that the tooltips on these child forms are gone. How do I get tooltips to show up on my child forms?

UPDATED:
I followed the advice of Sertac Akyuz and now everything works as it should.

LuFang
  • 191
  • 3
  • 12
  • Why are you using `SetParent()` directly? You should be using the Form's `Parent` property instead: `FormChild.Parent := MainForm;` – Remy Lebeau Nov 21 '18 at 08:07
  • @Remy If you do so, the child forms become with the inactive caption. In addition, the ability to switch between child forms by clicking on the mouse is lost. However, the tooltip becomes visible :) – LuFang Nov 21 '18 at 08:47
  • 4
    Forms are not intended to be embedded. Either use actual MDI, or use Frames instead. – Remy Lebeau Nov 21 '18 at 09:13
  • 3
    Yes, you'll hit [problem](https://stackoverflow.com/questions/42065369/how-to-parent-a-form-controls-wont-accept-focus) after [problem](https://stackoverflow.com/questions/5729295/how-to-create-a-delphi-form-containing-multiple-child-forms-that-can-be-moved) (search, and you'll find more). – Sertac Akyuz Nov 21 '18 at 10:02
  • @Remy Unfortunately, I can't use MDI because of the problems described here: [link](https://stackoverflow.com/questions/53387891/frame-on-main-form-with-formstyle-fsmdiform) – LuFang Nov 21 '18 at 10:23
  • 2
    @LuFang those are design problems, not technical problems. You need to rethink your design, like David said. – Remy Lebeau Nov 21 '18 at 10:37
  • Ok, thanks, I see. Need an answer to close the topic. – LuFang Nov 21 '18 at 12:14
  • I have a simple question for you. How can the user use UI that is being the MDI child windows? – David Heffernan Nov 22 '18 at 07:44
  • @DavidHeffernan Sorry, I'm not sure I understand what you're asking. – LuFang Nov 22 '18 at 09:56
  • You want to place UI inside the MID client window. When there are MDI child windows you want them to cover this UI. How will the user interact with UI that is covered by MDI child windows? – David Heffernan Nov 22 '18 at 10:03
  • For example, the background is an interactive calendar. The user clicks the cell of the day and receives the necessary information. However, he may have a couple of open MDI windows - [screenshot](https://image.ibb.co/kQRMKq/999.png) They do not interfere much with viewing the calendar. – LuFang Nov 22 '18 at 10:27
  • 1
    *".. interfere much .."* - That's a strange way to put it. ;-) Anyway, go SDI. Large main form with calendar, toolbar and whatnot. Secondary forms owned by the main form (MainFormOnTaskbar = True) will always remain on top. No fuss... The only difference is secondary forms can go beyond the main form. You can solve that with a full screen main form if that matters. – Sertac Akyuz Nov 22 '18 at 21:30
  • @SertacAkyuz Maybe you are right and there's nothing to do but to do so. – LuFang Nov 23 '18 at 05:27

0 Answers0