Design Tips...

Kieto
09-09-2001, 10:42 PM
Hi y'all.

I need some help on this...I've design my forms on a 800 x 600 resolution...how do I make sure that all the controls on my form are displayed properly if the resolution is different.

Also, right now the taskbar is on top of my form...how do I code it so it automatically knows to size within the taskbar instead of under it? And if the user hides the task bar, how do I resize the form to fit the screen? THANKS IN ADVANCE.


'Pass the coffee over...'

BillSoo
09-10-2001, 01:33 AM
If you MAXIMIZE your form (ie. set the windowstate to vbMaximize), it should fill up the screen excluding the taskbar.



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

senderap
09-10-2001, 02:51 PM
Check out a 3rd party control called SizerOne 7.0. It's under two hundred US dollars retail. They have a trial version that can be downloaded. It has a lot of good tools. www.componentone.com.

SenderaP

Kieto
09-11-2001, 12:44 AM
Is there any other way of doing this? I saw somewhere you are suppose to multiply each control on the form to a certain value?

'Pass the coffee over...'

Ad1
09-11-2001, 02:41 AM
if you store the width and height of your form in variables then you can divide by that and then times by the new dimensions
ie
<pre><font color=blue>For</font color=blue> i = 0 <font color=blue>To</font color=blue> Controls.count - 1
<font color=blue>If TypeOf</font color=blue> Controls(i) <font color=blue>Is</font color=blue> Timer <font color=blue>Then</font color=blue>
<font color=green>'do nothing</font color=green>
<font color=blue>Else</font color=blue>
Controls(i).Width = Controls(i).Width / lngWidth * Me.Width
Controls(i).Height = Controls(i).Height / lngHeight * Me.Height
Controls(i).left = Controls(i).left / lngWidth * Me.Width
Controls(i).top = Controls(i).top / lngHeight * Me.Height
<font color=blue>End If</font color=blue>
<font color=blue>Next</font color=blue> i
lngWidth = Me.Width
lngHeight = Me.Height</pre>certain controls such as timers, commondialog etc cannot be resized and should have code to ignore them as above

Laurent
09-11-2001, 05:33 AM
just so it realy looks nice you'll also need to resize the font.

there are many other resizing controls like sizerone here's another one

From Component Source, Resize Kit
1 developper license 50$

I'll be among the best soon, very soon!!!

Hajü Schwippert
09-11-2001, 08:32 AM
I have downloaded a module with appropriate code somewhere. When I'm home in an hour I can send it to you. It is basically the same as Ad1 says.

To err is human, to really foul things up requires a computer. images/icons/wink.gif

Hajü Schwippert
09-12-2001, 05:24 AM
Here is a class to resize your form. Just add it to your project and read the instructions. If you have further questions about it, I'm glad to answer.

To err is human, to really foul things up requires a computer. images/icons/wink.gif

Kieto
09-12-2001, 10:21 PM
Thanks Haju...I will try the code when I get the chance.
Thanks AD1...but how does the calculation work?

=)

'Pass the coffee over...'

Ad1
09-13-2001, 02:32 AM
it's a bit like working out percentages, basically if you double the width of the form then each control will double in width and each control's left property will double thereby keeping everything in proportion

ie say a controls width is 600, the form width is 5,000 and you change it to 10,000
600/5000*10000=1200

when the calculations have been done you set lngWidth and lngHeight to the new settings ready for the next form resize

like Laurent mentioned this is just a basic bit of code, you can add to it to change font sizes and other things using the same algorithm, NB: if you change fontsize make sure you do not go below 8 or you will get a run time error

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum