在紧凑的框架appliacation钩关闭(X)按钮 [英] Hook close (X) button in compact framework appliacation

查看:190
本文介绍了在紧凑的框架appliacation钩关闭(X)按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要尽我自己的行动上自来水(点击)关闭(在右上角X)按钮,在紧凑的框架appliaction。我使用的是Windows Mobile 6.1操作系统。

I want to do my own action on tap (click) to close button ( X in right top corner ) in compact framework appliaction. I'm using Windows Mobile 6.1.

Usualy我想默认行为,但有时我想改变用户控件在目前的形式。我怎样才能达到目标?

Usualy I want default behaviour, but sometimes I want to change the usercontrol on current form. How can I reach it?

谢谢!

推荐答案

的(X)按钮的没有的关闭按钮,这是一个聪明的最小化按钮,你不能直接挂接到它(你会得到一个已停用的事件可能是,但你无法取消)。

The (X) button is not a Close button, it is a Smart Minimize button, and you can't directly hook into it (You will get a Deactivated event probably, but you can't cancel that).

您可以更改表为假的MinimizeButton属性,它会变成一个(确定)按钮,你可以处理(如佩特罗斯指出)。你可以很可能使用IMessageFilter或子类的形式挂钩的WinProc也弄个尽量减少事件也是如此。

You can change the MinimizeButton property of the Form to false and it will change to an (ok) button, which you can handle (as Petros points out). You can likely use an IMessageFilter or subclass the form to hook its WinProc to also get hold of the minimize event as well.

另请参阅:

  • How to detect Smart Minimize
  • The emperor has no close
  • Subclassing CF apps
  • Subclass a button with native callbacks

这篇关于在紧凑的框架appliacation钩关闭(X)按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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