Winforms 最小化技术
我试图在按下最小化按钮时使我的应用程序“翻转”。通过翻转,它应该有点像翻转时的硬币。它向下“翻转”到任务栏。我想知道如何使用 C# 在 WinForms 中实现这样的效果。这可以完成吗?或者类似的事情需要使用 DirectX 来完成吗?
I am trying to make my application "flip" when the minimize button is pushed. By flipped, it should be kinda like a coin when flipped. It "flips" down into the taskbar. I am wondering how effects like this are accomplished in WinForms using C#. Can this be done or does something like this need to be done using DirectX?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以 P/Invoke AnimateWindow() 来获得这样的效果。请访问 pinvoke.net 获取您需要的声明。请注意,这种新颖性很快就会消失,一定要使其成为用户可选择的选项。
You could P/Invoke AnimateWindow() to get effects like this. Visit pinvoke.net for the declarations you'll need. Beware that the novelty of this wears off very quickly, definitely make it a user-selectable option.
我不知道,但您可以控制(包括动画)应用程序窗口中显示的内容。因此,执行您想要的操作可能需要您以动画方式将窗口移向任务栏,同时翻转其内容。
I don't know, but you can control (including animate) what's displayed within your application window. Doing what you want may therefore require you to animatedly move your window towards the taskbar, while flipping its contents.
这不是 WinForms 本身支持的。您可以尝试“模拟”翻转窗口,方法是将窗体的宽度缓慢缩小到 0,然后在该位置将另一个窗体增大到看起来像窗口“背面”的适当大小。
但是 winform 中没有类似动画或过渡的东西。为此,您需要转到 WPF。
This isn't something that WinForms natively supports. You could attempt to "simulate" a flipping window by shrinking the width of the form slowly to 0 and then growing another form at that location to the proper size that looks like the "back" of the window.
But there isn't anything like animations or transitions in winforms. You need to go to WPF for that.