Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Docking an application to the top or bottom of the screen

Status
Not open for further replies.

nwruiz

Programmer
Jun 22, 2005
60
US
Hello,

I am currently working on a program that will grab an RSS feed and display it as a ticker. I would like to allow the user to dock the application to the top or bottom of the screen and automatically resize the width of the application window to fit the entire screen width. What sort of control would I have to add to my application to achieve this goal?

Nick Ruiz
CO-OP Intern, PPL Electric Utilities
Webmaster, DealMerchant.net
 
I see a couple of options:

1. Create a set of buttons that say "Dock Left, Dock Top, blah blah.."

2. Create an on_mousemove(object sender, eventargs e) event. Everytime the mouse moves, calculate the form's position. If it is within 10 pixels of each side of the screen then reposition and resize it (form.Width = Screen.Width, Form1.Location = new Point(0,0))

The second one is cooler and not too tough.

Let me know how it goes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top