How to create a form like Windows taskbar using C #

I created a taskbar using tabcontrols, which works similarly to the windows taskbar. I want my taskbar to be docked on top of windows.

It shouldn't be movable, resizable, and it should be "docked" with the top.

+2


source to share


2 answers


I didn't try to do this, but the first attempt was as follows:

  • set the form as "TopMost"
  • set the border to "No"
  • set Location: (0,0), Size (Screen.Width, H) where H is the Height you want your shape to be
  • set 'ShowInTaskBar' to false

Something you might be thinking: how would you handle multiple screens?



You will probably want to add a context menu that allows you to exit the application, as it will not have the usual system buttons. Also, you might be wondering what happens when the user hits ALT-F4: will your program be closed? If not, you need to add code to your FormClosing event handler to cancel the closure.

Hope this puts you in the right direction!

+3


source


Long ago Jeffrey Richter demonstrated how to make a real taskbar in a sample AppBar (I used it myself as a boiler cooker), so here are a few pages that might be of interest:



http://www.google.com/search?q=Jeffrey+Richter+appbar+c#

+1


source







All Articles