Link to home
Start Free TrialLog in
Avatar of Shane Russell
Shane RussellFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Size Form dependant on screen resolution

I have this to get the screens resolution :

Dim scrX As Integer
Dim scrY As Integer

srcX = Screen.Width / Screen.TwipsPerPixelX
srcY = Screen.Height / Screen.TwipsPerPixelY

I would like to be able to set the forms height and width dynamically dependant on the end users screen resolution and so that the form fills the middle of the screen so that there are a few inches either side of the form between the edge of each side of the form and the edge of the monitor and at the same time to resize the controls on the form as relevant.

Any help would be very much appreicated!!!
SOLUTION
Avatar of rettiseert
rettiseert

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 rettiseert
rettiseert

And for resizing controls... that depends on how do you want they look. One easy way is to use a component like

http://www.vbgold.com/index.shtml#ActiveResizeControlLite

its free, and will do the job for you.
Avatar of Shane Russell

ASKER

How do I use that active resize control ? Do I go to project --> References and add the ocx control and then use it or do I have to add it as a component or what ?
Download the setup program for the lite (free) version on the control and run it.
In VB add it as a component.
Insert the control in your form.
SOLUTION
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
Besides the goofy looking forms, also remember that if someone has a high resolution set up, it's because they want the screen real estate... They don't *want* your form covering 90% of their 25 inch display.
Becuase I have 2 frames and within those frames I will be adding a file explorers similiar to nero burning rom and It would look funny if the frames were left in tact and the form changed especially since being able to read the names of the files if I or another user were trying to find specific music files to transfer to the mp3 player(s).

So I need it to be re sized to allowe for the screen resolution so that the items within the file explorers are legible.

It is mainly an application for myself that I am making because I normally swap between screen resolutions and I dont want to going back and forth between my mp3 player drive and finding the music I just want to be able to do it from one place just like Rio Music manager does.
FYI - The mp3 player I have is not a Rio Mp3 player so I dont get any software with it, the only thing I got with this mp3 player was some drivers and thats it !!
What controls are you using as file explorers?
ASKER CERTIFIED SOLUTION
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
Thanks for the help everyone !

I am using frames and I am still looking for some controls that are simmiliar to Nero where it displays the file explorer type interface on one side and then the directory ie files and folders on the other side, if that makes sense ?