my.Computer.Screen.WorkingArea retrieves incorrent width & height when screen resolution changes

D

danzhonguk

Just got a problem about "my.Computer.Screen.WorkingArea". It seems
not to work properly.

I have got my windows application developed with VB.NET in Visual
Studio 2005. What I want to do is to change the size of my forms when
screen resolution changes. With the application running, I changed the
screen resolution from 1280 x 1024 to 1024 x 768. My event has been
fired up successfully just after I click "Apply" button on the
"Display Property" dialogue box. But the width returned by
"my.Computer.Screen.WorkingArea" is still 1280 instead of 1024
although the screen resolution has already changed to 1024 x 768. This
problem prevents my sub routine from running properly.

Anyone encountered the same problem before and has any ideas about
that? If it is a bug, is there any workaround?

Any comments will be very much appreciated.
 
M

MikeY

The way I've done this in C# is that I have my application form size at a
set standard size ie: 600x800. I also have my forms "WindowState" under
properties set at Maximized so that when the program runs it takes up the
full monitor screen. That way, no matter what the resolution is set at, all
items ie: buttons will be displayed.

But then on another note. All monitors I work on, have a standard size
resolution.

Other than that, you probably need to change (everytime) the clientsize ie.
"this.ClientSize = new System.Drawing.Size(Whatever, Whatever). But then
you'll need to deal with anchors for all your controls and resize them as
well when resizing everything else. Once again I find it easier dealing with
"WindowState" cause everything will stay in the same location.

Hopefully I'm on the same page as you & hope that helps

MikeY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top