简体   繁体   中英

Changing shape of windows form and raise custom event

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM