Click here to Skip to main content
13,196,730 members (57,442 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Dear all i create one application in VS2008 C#. I use mdi form click event but it will not work. any one help me plz...
Posted 15-Jan-13 21:12pm
CHill60 16-Jan-13 4:13am
What doesn't work? Post your code for the event and say what it is that doesn't work and/or which line the problem is on
d@nish 16-Jan-13 4:27am
You need to be descriptive here. It's not easy to understand the question based on your post.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I am pretty sure that you are confusing the MDIForm container window, itself, to which you can assign certain interaction (Mouse) Events: but, those Events will never be triggered.

When you create a WinForm Project, and set the IsMDIContainer Property of the main (start-up) Form to 'true: it becomes a really different type of "animal" than a regular Windows Form.

You can wire-up mouse-related EventHandlers to the MDIForm: like: Click, MouseDown, Leave, MouseClick, MouseMove, Enter: none of those Events will be triggered. Note: I consider the fact you can assign EventHandlers to an MDIContainerForm in the design-time Visual Studio PropertyGrid a serious design flaw: in my opinion, those Events should never appear in the PropertyGrid for an MDIContainerForm.

However, you can assign Keyboard EventHandlers: if you set the MDIContainerForm's KeyPreview Property to 'true: you can write EventHandlers for Events like 'KeyDown: and they will be triggered.

The whole idea (if it ever was other than a "kludge") of MDI architecture was: end-users interacted with MDI ChildForms, not with their "Parent" Form turned into an MDIContainer !

By the way, MDI is now a kind of old "fossil," and it's butt-ugly as user-interfaces go, and it's deprecated by Microsoft.

There are better ways of handling multiple Forms/Windows !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171019.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100