Click here to Skip to main content
Rate this: bad
good
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
Comments
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
good
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 !
  Permalink  
v4

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

  Print Answers RSS
0 OriginalGriff 383
1 Richard Deeming 180
2 ChauhanAjay 176
3 Sergey Alexandrovich Kryukov 171
4 Yogesh Kumar Tyagi 165
0 Sergey Alexandrovich Kryukov 6,252
1 OriginalGriff 5,498
2 CPallini 2,473
3 Richard MacCutchan 1,627
4 Abhinav S 1,530


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