473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

MDI Child Windows Overlapped by control on Parent

Hello everyone.

I have an MDI form (parent) that has a number of controls on it. When I
display MDI child windows, the child windows appear behind the controls
that are on the parent window. How can make it so that the child window
are on top of the controls on the parent window.

Thanks in advance.

Diego

Apr 3 '06 #1
4 2907
Hello, Diego,

I think that it is a bit unusual to put controls directly on the MDI
form. If you do they will always be on top, as you've noticed.

Is there some reason that you can't put your controls on a toolbar?

If you really must do something like this, the only possibility that I
can think of is to draw fake images of your controls on the MDIClient
and do all of your own processing of mouse and keyboard events to
simulate the behaviour of real controls.

To me, this sounds like far too much trouble, and it has the associated
risk that goes with the caveat in the documentation for the MDIClient
that says: "The MdiClient type supports the .NET Framework
infrastructure and is not intended to be used directly from your code."

Cheers,
Randy
diego wrote:
Hello everyone.

I have an MDI form (parent) that has a number of controls on it. When I
display MDI child windows, the child windows appear behind the controls
that are on the parent window. How can make it so that the child window
are on top of the controls on the parent window.

Thanks in advance.

Diego

Apr 3 '06 #2
I've put many controls on a MDI parent, not unusual at all. However you
should put them on a container which you dock. Then you should have no
problems whatsoever.

Example:

http://www.espital.net/studyui.htm
"diego" <di******@yahoo.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
Hello everyone.

I have an MDI form (parent) that has a number of controls on it. When I
display MDI child windows, the child windows appear behind the controls
that are on the parent window. How can make it so that the child window
are on top of the controls on the parent window.

Thanks in advance.

Diego

Apr 3 '06 #3
Hi Randy,

Thanks for your reply.

What I want to place on the MDI form is a Web browser control to
display a page from a pre-determined site. This page may contain
announcements, warnings, etc. for the users.

Is this possible?

Thanks in advance.

Deigo

Apr 4 '06 #4
Hello, Diego,

I don't think it is possible to do this directly. It would be easy to
put it onto some sort of a docked container control, but I guess this is
not what you want.

If the contents are for "display-only", and you do not need any active
controls on the MDI background you might be able to find a way to copy
the image of the Web page to the MDIClient.

I don't know offhand how you would get the image from the web page, but
if you can then you could do something like this:

Private WithEvents mFrame As MdiClient ' MDI Client window frame.

You will need to "find" the MDIClient. Maybe there are better ways, but
this has worked for me:

For Each ctlCurrent As Control In Me.Controls
If (TypeOf ctlCurrent Is MdiClient) Then
mFrame = DirectCast(ctlCurrent, MdiClient)
Exit For
End If
Next ctlCurrent

I have used this in the first pass of the MDI Form's Activate event, but
have recently learned that .Net 2005 provides a "Shown" event that may
be better for this.

Then, use the Paint event of the MDIClient to display the image of your
web page.

Private Sub MDIControl_Paint(ByVal sender As Object, _
ByVal e As PaintEventArgs) _
Handles mFrame.Paint
' Copy the image here using e.Graphics
. . .

End Sub

But again, don't forget the caveat that "The MdiClient ... is not
intended to be used directly from your code." And if you want to
simulate active controls on the MDI background, this will become much
more difficult. There might be better/easier ways to accomplish the
functionality that you want.

Good luck,
Randy
diego wrote:
Hi Randy,

Thanks for your reply.

What I want to place on the MDI form is a Web browser control to
display a page from a pre-determined site. This page may contain
announcements, warnings, etc. for the users.

Is this possible?

Thanks in advance.

Deigo

Apr 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dayne | last post by:
Can a Parent thread catch a event send by a child thread? Dayne
0
by: Jim dunn | last post by:
HI I am having problems with C# with regards to its compatibility with win32 API methods, I am trying to read from a windows CE comm port using C# and imported methods from coredll.dll, it seems...
2
by: Guy Babbitt | last post by:
I have an MDI application that starts an instance of a child form at application start. I have an event handler on a combo box checking for the selected value to change. When the select value...
8
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
3
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
0
by: Bruin | last post by:
Hi All, I'm having a problem with MDI child forms when the reference to the MDI Parent is set in a Control library. (Sorry for the long post) I have an control library assembly which holds all...
2
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.