改变窗口形状并引发自定义事件
我正在创建一个像“Rocket Dock”这样的应用程序。我想
1)更改窗口窗体的默认形状。如曲线边缘等。 2)如何引发事件,以便当我将光标移动到屏幕顶部时,我的应用程序会出现,而当离开界面时,它会向上移动并消失?
I am creating an application like "Rocket Dock. I want to
1) Change the default shape of the windows form. Like curve edges etc.
2) How can I raise event so that when I move cursor to the top of the screen, my app appears and when leave the interface it moves upward and disappear?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1) 有几种方法可以创建自定义 WinForm 形状
1a) 将窗体的背景设置为图像并使用透明度键:
http://msdn.microsoft.com/en -us/library/aa289517%28v=vs.71%29.aspx
1b) 使用 System.Drawing 定义自定义形状并设置表单区域到您新创建的路径:
http://codegod.org/WebAppCodeGod /Creating-Custom-Shapes-for-Forms-in-Windows-Forms-AID377.aspx
2) 将表单折叠到非常小的尺寸并挂钩MouseEnter(或MouseHover)事件触发“进入”效果。可以hook Form的MouseLeave事件来触发“离开”效果。
1) There are a couple of ways to create a custom WinForm shape
1a) Set the form's background to an image and use a transparency key:
http://msdn.microsoft.com/en-us/library/aa289517%28v=vs.71%29.aspx
1b) Define a custom shape using System.Drawing and set the forms region to your newly created path:
http://codegod.org/WebAppCodeGod/Creating-Custom-Shapes-for-Forms-in-Windows-Forms-AID377.aspx
2) Collapse your form to a very small size and hook the MouseEnter (or MouseHover) event to trigger the "entering" effect. You can hook the Form's MouseLeave event to trigger the "leaving" effect.