To slide down, you need to change
of your wallpaper-showing window. Start near the top, then gradually set your window to move lower and lower.
That for you will need some events to trigger the Location change. Typically you would use a
Interval = 40
I personally would also run a
to control the window motion. Timer to create the event, Stopwatch to process exact location. This is because
's precision is a lot better than that of a
So you would have something like
double panningTimeMs = 500D;
private void PanningTimer_Tick( object sender, EventArgs e)
int elapsedMilliseconds = _panningStopwatch.ElapsedMilliseconds;
if( elapsedMilliseconds > panningTimeMs)
elapsedMilliseconds = panningTimeMs;
int windowTop = -this.Height + ( this.Height * elapsedMilliseconds / panningTimeMs);
this.Location = new System.Drawing.Point( this.Location.X, windowTop);
For detecting the upwards slide, override
. Check mouse position and decide whether it qualifies as movement starting point. Set a member field if it does.
and check whether you're in sliding mode (that's what the member field was for). If so, check mouse position. If it is far enough up the screen, remove the lock.
as well and check for sliding mode. Reset the mentioned member field if mouse position is still to near the bottom to release lock.
For the extra double-lock button, you could use a
Appearance = Appearance.Button
. If checked, the button will remain pressed, until you uncheck it. You could then check the
property to determine if you do all the other sliding stuff.