Link to home
Start Free TrialLog in
Avatar of kbach
kbach

asked on

Change Screen Resolution Doesn't move status Bar

I'm using EnumDisplaySettings and ChangeDisplaySettings to change the screen resolution from VB if it's under 1024X768.  Everything works, except that the Windows status bar at the bottom doesn't adjust to the new screen resolution...you have to click and drag it to the bottom manually.

Another problem is that after I change the resolution... when I retrieve the resolution the Screen object reports both the Width and the Height in pixels as the Height.  For example, I change from 800X600 to 1024X768 and it works great (except the status bar problem)...but, when I check again for the resolution both the X and Y pixel values come back as 768 because the Screen object's Width property is reporting improperly...hmmm, anybody have any ideas?

Thanx
Avatar of Stoftrinator
Stoftrinator

Hi kbach,

Did you try this (probably you already did)

windowstatusbar.width = ...

Good luck!
Avatar of kbach

ASKER

well it's the Windows status bar, like with the start menu and task bar, clock, etc. along the bottom, and it's not just the width, it's positioned to high and to far to the left (based still on the old resolution settings I assume...)

One other thing I'm noticing, is that SOMETIMES the screen object returns the proper pixels but sometimes the width is set to the height?  I don't change the code, and I can't understand why the inconsistent results, I think I'm going to have to forget the idea, we'll see...
ASKER CERTIFIED SOLUTION
Avatar of hes
hes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kbach

ASKER

Hes,

You rock, I wasn't passing in the CDS_UPDATEREGISTRY to ChangeDisplaySettings and that was causing the error in the Windows task bar position.  As that was my largest problem I'll give you the points.  BUT...I'm hoping you might be able to help with the other part too...

After the change, the Screen.Width is reporting the same value that the Screen.Height is, which is puzzling.  So, after I change from 800X600 to 1024X768 and want to change back, it tells me that the current settings are 768X768...

Now...I can work around this because the Screen.Height property seems to stay correct all the time, so I can pull that value and then assume what the width should be based on the height, but it's a little glitch that bugs me because all my forms center themselves based on the Screen object and with the inconsistencies, I've got to go back and change that code...