WindowsForms中的事件 [英] Events in WindowsForms

查看:73
本文介绍了WindowsForms中的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows窗体应用程序

我有2个PictureBox,其中一个在第二个的前面.

两个pictureBox都有一个doubleClick_event(Object Sender,EventArgs)函数.

当我双击它们上方时,只会触发一个事件,一个事件
与前面的pictureBox关联.
后面的pictureBox不会响应我的点击,尽管它
在与第一个相同的区域.

我该怎么办,以便制作第二个pictureBox,那个是
隐藏在第一个PictureBox的事件中,以响应我的doubleClick吗?
解决方案

在单击第一个PictureBox时调用第二个PictureBox的事件.

如果前面有控件,它永远不会触发.


I have a Windows Form Application

I have 2 pictureBoxes , one in the front of the seconde one .

Both pictureBoxes have a doubleClick_event( Object Sender ,EventArgs ) function .

When I double-click above them , only one event is trigered , the one
associated with the pictureBox that''s in front .
The pictureBox that''s in the back doesnt respond to my click ,although its
in the same area as the first one .

How can I do ,in order to make the second pictureBox ,the one that''s
hidden in the back of the first one , to respond to my doubleClick ?

解决方案

call the event for the second PictureBox when the first one is clicked.

It''s never going to fire if you have a control in front of it.


这篇关于WindowsForms中的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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