|
-
Feb 16th, 2007, 04:57 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2005] Tough Parent Question
At least it's a tough one for me:
1) Open Form A
2) In The Declarations Within Form A Declare frmB as New FormB
3) In the Load Event of Form A State: frmB.Parent = Me (i.e. Form A).
Question: Does this effectively make frmB a Control of Form A in the same sense that a TextBox on Form A is a control.
If not, what exactly is happening. I need to know.
Thanks
-
Feb 16th, 2007, 05:05 PM
#2
Frenzied Member
Re: [2005] Tough Parent Question
Not sure, but did that code actually run without crashing?
-
Feb 16th, 2007, 05:33 PM
#3
Thread Starter
Frenzied Member
Re: [2005] Tough Parent Question
Yup, runs just fine. I just need to know exactly what the relationship of FormA is To FormB. Because in this situation FormB behaves exactly like a control or FormA in the sense that any other control behaves.
I think that's what occurs here but I really need to verify what's happening in the background. Does FormB (or frmB) in this example actually become a control of FormA?...
-
Feb 16th, 2007, 07:07 PM
#4
Hyperactive Member
Re: [2005] Tough Parent Question
As far as I know, yes. But to verify try this:
For each x as Control in me.Controls
MessageBox.Show(x.Name)
Next x
If frmB shows up then it's one of FormA's controls.
-
Feb 16th, 2007, 07:30 PM
#5
Thread Starter
Frenzied Member
Re: [2005] Tough Parent Question
Yup! Thanks for the suggestion. I just learned alot. Probably should have known it anyway since that seems to be just one step away from a user control.
So there ya go...
-
Feb 17th, 2007, 11:59 AM
#6
Lively Member
Re: [RESOLVED] [2005] Tough Parent Question
to add Formb to formA as controll
do that
1- set the toplevel to false for formb
2- formA.controls.Add(formb)
now formb will be like any textbox or command bottun on form
A
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|