Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the taskbar's position and size?

Tags:

c#

I want to know how to get the rectangle (bottom, top, left, and right) that the taskbar occupies. How do I go about doing this in C#?

like image 664
Ravi Naik Avatar asked Aug 12 '09 05:08

Ravi Naik


People also ask

How do I fix my taskbar size?

Click and hold the top of the taskbar where the desktop and taskbar meet. When the mouse hovers over this area, it should change to a double-sided arrow. Drag downward to make the taskbar smaller. Let go when it's at the size you want (stopping at the bottom of the screen is the smallest it can be with this method).

Why can't I change my taskbar location?

To change the position of the taskbar, right-click on an empty space in the taskbar and click on Taskbar options. Once you're in Taskbar settings, scroll down until you see the drop-down menu to change the location of the taskbar. You'll see options to change the location to the left, top, right, or bottom.

How do I change my taskbar color and position?

If you want to change your Windows 11 taskbar position, go to Taskbar alignment settings, and select Left in the drop-down menu. To change your taskbar color, enable Show accent color on Start and taskbar, go to Accent color, and choose the color you want to use.


1 Answers

    private enum TaskBarLocation { TOP, BOTTOM, LEFT, RIGHT}      private TaskBarLocation GetTaskBarLocation()     {         TaskBarLocation taskBarLocation = TaskBarLocation.BOTTOM;         bool taskBarOnTopOrBottom = (Screen.PrimaryScreen.WorkingArea.Width == Screen.PrimaryScreen.Bounds.Width);         if (taskBarOnTopOrBottom)         {             if (Screen.PrimaryScreen.WorkingArea.Top > 0) taskBarLocation = TaskBarLocation.TOP;         }         else         {             if (Screen.PrimaryScreen.WorkingArea.Left > 0)             {                 taskBarLocation = TaskBarLocation.LEFT;             }             else             {                 taskBarLocation = TaskBarLocation.RIGHT;             }         }         return taskBarLocation;     } 
like image 134
Mike Avatar answered Sep 20 '22 16:09

Mike