namespace slide2view { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width; this.Top = Screen.PrimaryScreen.WorkingArea.Top - this.Height + 1; } private void tmSlide_Tick(object sender, EventArgs e) { Point pos = Control.MousePosition; bool inForm = pos.X >= this.Left && pos.Y >= this.Top && pos.X < this.Right && pos.Y < this.Bottom && this.Top <= Screen.PrimaryScreen.WorkingArea.Top - 1; if ( inForm) this.Top += 5; } private void tmSlideUp_Tick(object sender, EventArgs e) { Point pos = Control.MousePosition; bool inForm = pos.X < this.Left && pos.Y < this.Top && pos.X > this.Right && pos.Y > this.Bottom && this.Top >= Screen.PrimaryScreen.WorkingArea.Top + 1; if (inForm) this.Top -= 5; } private void Form1_MouseDown(object sender, MouseEventArgs e) { this.tmSlide.Enabled = true; this.tmSlideUp.Enabled = false; } private void button1_Click(object sender, EventArgs e) { this.tmSlide.Enabled = false; this.tmSlideUp.Enabled = true; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)