You no need to create your own instead you can do it with menustrip also
you have to use threading for that
may this code useful to you
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (e.y < 40)
{
this.BeginInvoke((ThreadStart)delegate()
{
MenuShow();
});
}
else if (e.y > 100)
{
this.BeginInvoke((ThreadStart)delegate()
{
MenuHide();
});
}
}
private void MenuShow()
{
while (menuStrip1.Top != 0)
{
menuStrip1.Top++;
Thread.Sleep(10);
menuStrip1.Update();
}
}
private void MenuHide()
{
while (menuStrip1.Top != -25)
{
menuStrip1.Top--;
Thread.Sleep(10);
}
}