Proportional Forms

J

jp2msft

In the plant, we have monitors that range in size, and we force our
application to be full screen.

The font for the screen has been designed for 800x600 screens, which is the
smallest size resolution that we use here.

However, whenever someone runs the form on a monitor that has the resolution
set higher (like 1600x1200), the text is too small to be read from a distance.

Is there a simple way to tell the application to fit the screen width
without having to go into each control and setting the fonts for them all?

Thanks,
Joe
Using Visual Studio 2005
 
K

kimiraikkonen

In the plant, we have monitors that range in size, and we force our
application to be full screen.

The font for the screen has been designed for 800x600 screens, which is the
smallest size resolution that we use here.

However, whenever someone runs the form on a monitor that has the resolution
set higher (like 1600x1200), the text is too small to be read from a distance.

Is there a simple way to tell the application to fit the screen width
without having to go into each control and setting the fonts for them all?

Thanks,
Joe
Using Visual Studio 2005

Well, at first thought, you can determine current computer's screen
size and if it's larger than 800x600 then increase the font size to a
reasonable level by instantiating a new font object of the controls
like this on form_load event:

'----------------------------
' Use Screen Class for that purpose
For Each ctrl As Control In Me.Controls
If Screen.PrimaryScreen.Bounds.Height.ToString > 600 _
AndAlso Screen.PrimaryScreen.Bounds.Width > 800 Then
' eg: If larger than 800x600, increase Button's font size to 25
ctrl.Font = New Font("Arial", 25)
End If
Next
'---------------------------

Hope this works,

Onur Güzel
 
M

Martin H.

Hello Joe, hello Onur,

When changing the font size, please keep in mind that not all controls
have the AutoSize function (e.g. TextBox controls). Therefore you would
have to change the size of that control yourself. You also would have to
rearrange the controls accordingly as labels (which have AutoSize) would
change their size and destroy your layout.

Maybe you should consider to buy new monitors which could display about
1280x1024. If you designed your application for that resolution you
would have no problem with 1600x1200.

Best regards,

Martin
 
K

kimiraikkonen

Well, at first thought, you can determine current computer's screen
size and if it's larger than 800x600 then increase the font size to a
reasonable level by instantiating a new font object of the controls
like this on form_load event:

'----------------------------
' Use Screen Class for that purpose
For Each ctrl As Control In Me.Controls
If Screen.PrimaryScreen.Bounds.Height.ToString > 600 _
AndAlso Screen.PrimaryScreen.Bounds.Width > 800 Then
' eg: If larger than 800x600, increase Button's font size to 25
ctrl.Font = New Font("Arial", 25)
End If
Next
'---------------------------

Hope this works,

Onur Güzel

I want to make addition related to my previous post, however it would
also be possible to just increase Form's Font size because when done
it applies on all the controls on the form and you wouldn't worry for
the controls' size-fitting problems because of new enlarged font.

So, you can also consider:
'----------------------------
' Use Screen Class for that purpose
If Screen.PrimaryScreen.Bounds.Height.ToString > 600 _
AndAlso Screen.PrimaryScreen.Bounds.Width > 800 Then
' eg: If larger than 800x600, increase Button's font size to 20
' Referring current form instance
Me.Font = New Font("Arial", 20)
End If
'---------------------------

BTW, don't forget that when you increase form's font size, form's own
size also will be bigger depending on the font size value you
specified.

Onur Güzel
 
J

jp2msft

Martin H. said:
Maybe you should consider to buy new monitors which could display about
1280x1024. If you designed your application for that resolution you
would have no problem with 1600x1200.

Hah! Yeah, right. Try telling that one to management! The monitors they have
out there are all 10 to 20 years old. Only after management upgrades their
computers and monitors do the machines out on the floor get updated - and
then, they only get the old PC that was replaced!
 
J

jp2msft

Your answer is correct, but actually I want the application to fit the
screen, not just a way to increase the font size.

Microsoft's 'premier software development platform' should have an option
that allows a Software Developer to specify that a form must keep its overall
proportions no matter what size the screen or form is.

For example: Flash files resize easily to fit their containers while keeping
their proportions. I'm interested to know if MS has anything similar that I
don't know about.
 
K

kimiraikkonen

MS has pulled the official download page though.  This requires framework 3.0
(which is 2.0 with WCF, WF, and WPF added).

Yes, MS doesn't host these WPF extensions anylonger officially. Maybe
they found some compatiblity issues or problems related to extensions
with 2005 and they decided to force people to download VS 2008... :)

Thanks,

Onur Güzel
 
C

Chris Dunaway

In the plant, we have monitors that range in size, and we force our
application to be full screen.

The font for the screen has been designed for 800x600 screens, which is the
smallest size resolution that we use here.

However, whenever someone runs the form on a monitor that has the resolution
set higher (like 1600x1200), the text is too small to be read from a distance.

Is there a simple way to tell the application to fit the screen width
without having to go into each control and setting the fonts for them all?

Thanks,
Joe
Using Visual Studio 2005

Perhaps this will help you:

http://msdn.microsoft.com/en-us/library/ms229605(VS.80).aspx

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top