Click here to Skip to main content
11,802,442 members (70,840 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
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 at 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 at 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
0 OriginalGriff 445
1 KrunalRohit 366
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,645
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
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