views:

131

answers:

1

Sorry if this is a fundamental question and I'm just stupid :)

I am building a sidebar application, it uses System.Windows.Forms.Screen.PrimaryScreen.WorkingArea to set the appropriate widths and heights and locations.

I want to now reduce the working area of the desktop so that when forms maximise, the sidebar is still shown (in the same way that the Vista or Google sidebars do)... but trying to set the Width on the WorkingArea.Width property gives me an error about the WorkingArea (a System.Drawing.Rectangle) not being a property.

What can I do to change the width of the WorkingArea to prevent forms overlapping my sidebar? Thanks in advance!

+1  A: 

Actually looking at this in more detail, it looks like it is much more involved and requires Win32 API calls to get the job done and get the exact same behavior.

This link contains some sample code on how to get it done. (Sorry, its ExpertsExchange, so scroll down, but it is a full sample.)

Mitchel Sellers
I had a worry it would involve some 'proper' shell programming :) Thanks.
Rich