Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2008 make my form fit any size screen, same resolution

$
0
0
This is probably a classic problem that others have had. I have done some reading, and some websites say "Do it this way", and others give a solution that is totally different. I designed my program with forms to fit 1920 x 1080 resolution, as all the computers this program will be running on is windows 7, and that is the recommended resolution. Every computer has a flat screen with a viewable size of 10.5 inchs by 18 inchs. The problem is, I have a laptop with a smaller screen size 7.5 inches by 13.5 inches. I want to eventually be able to allow the user to zoom in and see the buttons bigger with bigger text as one or two employees at work can not see very well, and by having this sub working, it wouldn't be too hard to implement this idea too later on down the road.

That being said, here is the basic idea I was thinking of; the syntax may or may not be correct, so follow the idea:

Code:

get screen dimensions ' not for sure how to do this just yet, can't be hard though
get form dimensions ' not for sure how to do this just yet, can't be hard though

if form dimensions > screen dimensions
    figure percent bigger 'assume it is 10% to big
    Form.width = (form.width * .9)
    Form.height = (Form.height * .9)
    for each C as control in Form
        c.width = (c.width * .9)
        c.height = (c.height * .9)
        c.fontsize = (c.fontsize * .9)
    end for
end if

I want this to apply to each form individually, as some forms have more controls and functionality than others. Each time a different form loads, I had considered having it call this routine from my module that has all my subs and functions in it.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>