Making a graphical element "dock-like"
Specifically, what I am try to is overlap my element on top of everything, including the desktop, similar to the taskbar in Windows. I have a Windows Form Control that looks kind of like a tab. its like 50px wide by like 150px in length. What I would like to do is have that control appear in front of all windows, including the desktop itself. I say "dock-like" because I belive开发者_运维技巧 docking pushes windows over (so if my tab was docked, it would push any full screen application window over 50px), which is not what I'm trying to do. I want my tab to overlay on top of everything. The closest example I can think of is Winamp. Winamp can dock to the top of the screen and it is always on top of any application.
how can do this in C#?
System.Windows.Forms.Form
has a property, TopMost
, which will cause the form to stay on top of other windows.
The "snapping" behavior of Winamp can be implemented by using the Move
event of the form--when the form is moved close enough to the edge of the screen, programatically set the position so that it's on the edge.
精彩评论