在紧凑的框架appliacation钩关闭(X)按钮紧凑、框架、按钮、appliacation

2023-09-03 07:36:04 作者:忘了爱°Toro

我要尽我自己的行动上自来水(点击)关闭(在右上角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检测智能最小化 皇帝没穿关闭 子类CF应用 子类,本地回调 按钮 How to detect Smart Minimize The emperor has no close Subclassing CF apps Subclass a button with native callbacks