Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2007, 02:08 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

a) frmParent is the name of the class, not an instance of that form.
b) you want the instance of frmParent, not its MdiParent (it IS the parent you want).

There are ways of working out which form a user control is on, I just can't remember how to do it off the top of my head.

/- Sam Judson : Wrox Technical Editor -/
 
Old October 10th, 2007, 03:28 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Its the ParentForm property.

For example:

if( this.ParentForm.IsMdiChild ) Child2.MdiParent = this.ParentForm.MdiParent;
if( this.ParentForm.IsMdiContainer ) Child2.MdiParent = this.ParentForm;

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Open ChildForm from UserControl (MDIParent) juzjess C# 2005 2 November 13th, 2007 05:07 AM
Horizontal scroll bar when childform is maximize juzjess C# 2005 1 November 7th, 2007 05:04 AM
Open document, Open second doc and copy to first justabeginner Word VBA 1 March 7th, 2007 02:47 AM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 10:08 PM
Attempted to open a database that is already open person747 Access 10 September 3rd, 2004 04:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.