Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
danzhonguk@yahoo.co.uk - 26 Jun 2007 16:23 GMT
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.
MikeY - 26 Jun 2007 16:53 GMT
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

> Just got a problem about "my.Computer.Screen.WorkingArea". It seems
> not to work properly.
[quoted text clipped - 13 lines]
>
> Any comments will be very much appreciated.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.