 |
|
 |
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: HELP! (Again) This time on screen resolution... lol
It used to be have all programs fit on a 800x600 resolution (that is, designed for). Now it's 1024x768 - XP's default, and the standard resolution for many PC's.
[meaning: you shouldn't have designed it for 1600x1200, some monitors don't support that resolution [smaller LCDs]].
But for your problem, the easiest thing would be to redesign the form, just make all the controls smaller by the same amounts.
EX:
Select all labels, go to the properties, subtract x from the width, x from the height->it will resize all of the labels at the same time. Do the same for all controls. Then manually move all of them, save (if it looks right) and compile/run.
Otherwise you'd have to keep track in code of the form's size, the current screen resolution, and resize the controls via code, and move the controls via code. I've done it before, but it's a lot easier to do it in design.
For help in the future, set your computer's resolution at 1 step higher than 1024x768. That way your design window in VB (with the immediate pane, properties and controls pane visible) is about the size of a 1024x768 screen. as long as everything is visible there, it should be at that resolution.
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
27-02-2003 at 11:35 PM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: HELP! (Again) This time on screen resolution... lol
No two are the same size? that's weird. but then you just have to resize them all manually.
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
28-02-2003 at 04:28 AM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: HELP! (Again) This time on screen resolution... lol
That code is useful, but the hardest part is actually moving the controls on the form so it looks the same way. By the time you get that coded (since each control has to be done separately [bit easier if in an control array]), you could've already resized it in design mode.
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
28-02-2003 at 08:07 AM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: HELP! (Again) This time on screen resolution... lol
You can, but the referencing can be tricky.
.Left/Top properties would have to be subtracted by the same percentage as the width/height, this leads to a potential funny spacing (ex: division won't end up with a even number all the time, some may have 100 result, others 101 or even 99 [rounding issues]) which can lead to problems if you're wanting columns/rows of different controls or labels for text boxes, or even a control inside a shape/picturebox.
Also have to take into account the fonts, if the current are meant to take up the entire area, a smaller area may mean the font size won't work, so you may have to change the font size.
Basically I look at it like this:
50 controls resized manually: 10 min
50 controls code changes, verifying text, changing resulution for all possible used (to make sure will work properly), tweaking division algorithm so all rounds are the same: a more than 10min (generally).
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
28-02-2003 at 08:59 AM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: HELP! (Again) This time on screen resolution... lol
The "Screen" option ("Screen." in vb) displays different screen attributes (like current size).
Comtrols are much easier to resize when the form is created with the minimum size required for everything to work (800x600 or 1024x768 resolutions), and then resizing/moving everything in the form_resize. Basically it's the same as when a form is resized by the user.
IE:
In the form_Load you'd have a line (or two) to resize the form based on the screen resolution. In the form_resize the code that places the controls based on the current form size [changing the form size if it's not at least as big as the minimum required].
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
01-03-2003 at 12:11 AM |
|
|
|
|
 |
 |