Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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 September 18th, 2008, 09:49 PM
Registered User
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I have a MDI application.
On Parent Form, i put a textbox and button.
And then i show child form like this code:
frmChild.TopMost = true;

The problem is, the textbox and button is still stay on the top when i show child form.
How to fix, so that the child form (frmChild) is the top most of other control in parent form? thanks
Old September 25th, 2008, 11:05 PM
Friend of Wrox
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts

Give this a try:

In the code that invokes the second (child form), probably a button click event code method. If that button is called btnLoadChild, then:

private void btnLoadChild_Click(object sender, EventArgs e)
   frmChild frm = new frmChild();

Since you've set up the parent as an MDI client, the child form appears on top of the MDI parent form. (I like to set the parent's WindowSize property to Maximum.) You can have a Close button on the child form that calls Close() to unload the form when you're done and control returns to the parent.

See page 393 of my book for additional details if you need them.

Dr. Purdum

Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying MDI Child Form Menus with MDI Parent ashu_from_india Pro VB 6 3 June 10th, 2008 11:01 PM
Controlling MDI child form from MDI parent panel LuxCoder Pro Visual Basic 2005 1 May 25th, 2007 12:20 PM
Controlling MDI child form from MDI parent panel LuxCoder VB.NET 2002/2003 Basics 7 April 11th, 2007 02:38 PM
Controlling MDI child form from MDI parent panel LuxCoder VB How-To 1 April 9th, 2007 03:25 PM
Controlling MDI child form from MDI parent panel LuxCoder Visual Basic 2005 Basics 2 April 9th, 2007 03:24 PM

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