Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Comments
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
dan!sh 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

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 !
 
Share this answer
 
v4

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900