Hints disappear when assigning a parent
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.
forms delphi tooltip parent-child delphi-10.2-tokyo
|
show 8 more comments
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.
forms delphi tooltip parent-child delphi-10.2-tokyo
Why are you usingSetParent()
directly? You should be using the Form'sParent
property instead:FormChild.Parent := MainForm;
– Remy Lebeau
Nov 21 '18 at 8:07
4
Forms are not intended to be embedded. Either use actual MDI, or use Frames instead.
– Remy Lebeau
Nov 21 '18 at 9:13
3
Yes, you'll hit problem after problem (search, and you'll find more).
– Sertac Akyuz
Nov 21 '18 at 10:02
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
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
|
show 8 more comments
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.
forms delphi tooltip parent-child delphi-10.2-tokyo
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.
forms delphi tooltip parent-child delphi-10.2-tokyo
forms delphi tooltip parent-child delphi-10.2-tokyo
edited Dec 3 '18 at 10:20
LuFang
asked Nov 21 '18 at 6:11
LuFangLuFang
1168
1168
Why are you usingSetParent()
directly? You should be using the Form'sParent
property instead:FormChild.Parent := MainForm;
– Remy Lebeau
Nov 21 '18 at 8:07
4
Forms are not intended to be embedded. Either use actual MDI, or use Frames instead.
– Remy Lebeau
Nov 21 '18 at 9:13
3
Yes, you'll hit problem after problem (search, and you'll find more).
– Sertac Akyuz
Nov 21 '18 at 10:02
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
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
|
show 8 more comments
Why are you usingSetParent()
directly? You should be using the Form'sParent
property instead:FormChild.Parent := MainForm;
– Remy Lebeau
Nov 21 '18 at 8:07
4
Forms are not intended to be embedded. Either use actual MDI, or use Frames instead.
– Remy Lebeau
Nov 21 '18 at 9:13
3
Yes, you'll hit problem after problem (search, and you'll find more).
– Sertac Akyuz
Nov 21 '18 at 10:02
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
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
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 8:07
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 8:07
4
4
Forms are not intended to be embedded. Either use actual MDI, or use Frames instead.
– Remy Lebeau
Nov 21 '18 at 9:13
Forms are not intended to be embedded. Either use actual MDI, or use Frames instead.
– Remy Lebeau
Nov 21 '18 at 9:13
3
3
Yes, you'll hit problem after problem (search, and you'll find more).
– Sertac Akyuz
Nov 21 '18 at 10:02
Yes, you'll hit problem after problem (search, and you'll find more).
– Sertac Akyuz
Nov 21 '18 at 10:02
2
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
@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
1
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
".. 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
|
show 8 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406186%2fhints-disappear-when-assigning-a-parent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406186%2fhints-disappear-when-assigning-a-parent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why are you using
SetParent()
directly? You should be using the Form'sParent
property instead:FormChild.Parent := MainForm;
– Remy Lebeau
Nov 21 '18 at 8:07
4
Forms are not intended to be embedded. Either use actual MDI, or use Frames instead.
– Remy Lebeau
Nov 21 '18 at 9:13
3
Yes, you'll hit problem after problem (search, and you'll find more).
– Sertac Akyuz
Nov 21 '18 at 10:02
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
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