单击甚至在C#MDI表单中 [英] Click Even In C# MDI Form

查看:79
本文介绍了单击甚至在C#MDI表单中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,我在VS2008 C#中创建了一个应用程序。我使用mdi表单点击事件但它不起作用。任何人帮我PLZ ...

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...

推荐答案

我很确定你混淆了MDIForm容器窗口本身,你可以指定某些交互(鼠标)事件:但是,这些事件将永远不会被触发。



创建WinForm项目时,设置主要的IsMDIContainer属性(形式为''真实:它变成了一种与常规Windows形式完全不同的动物类型。



可以与MDIForm相关的与鼠标相关的EventHandlers:如:Click,MouseDown,Leave,MouseClick,MouseMove,Enter:这些事件都不会被触发。注意:我认为你可以分配的事实在设计时Visual Studio PropertyGrid中的一个MDIContainerForm的EventHandlers一个严重的设计缺陷:在我看来,那些事件应该永远出现在PropertyGrid中的MDIContainerForm。



但是,您可以指定Keyboard EventHandlers:if你将MDIContainerForm的KeyPreview属性设置为''true:你可以为像'KeyDown这样的事件编写EventHandler,它们将被触发。



MDI架构的整个想法(如果它不是kludge)是:最终用户与MDI ChildForms 交互,而不是将他们的父表格变成MDIContainer !



顺便说一下,MDI现在是一种古老的化石,它随着用户界面的变化而变得非常丑陋,而且它'''被Microsoft弃用。



有更好的方法来处理多个表格/ Windows!
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 !


这篇关于单击甚至在C#MDI表单中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆