比例表格 [英] Proportional Forms

查看:93
本文介绍了比例表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工厂,我们有尺寸范围的显示器,我们强制我们的

应用程序全屏。


屏幕的字体设计用于800x600屏幕,这是我们在这里使用的最小尺寸分辨率。


但是,每当有人在显示器上运行表格时分辨率

设置得更高(如1600x1200),文字太小,无法从远处读取。


有一种简单的方法可以告诉应用程序适合屏幕宽度

而不必进入每个控件并为它们设置所有字体?


谢谢,

Joe

使用Visual Studio 2005

解决方案

10月1日,6:37 * pm,jp2msft< jp2m .. 。@ discussion.microsoft.comwrote:


在工厂,我们有尺寸范围的显示器,我们强制我们的

申请全屏。


屏幕的字体设计为800x600屏幕,这是我们在这里使用的

最小尺寸分辨率。


但是,每当有人运行表格时在分辨率为

设置得更高的显示器上(如1600x1200),文字太小,无法从远处读取。


有没有简单的告诉应用程序适合屏幕宽度的方式

而不必进入每个控件并为它们设置所有字体?


谢谢,

Joe

使用Visual Studio 2005



嗯,首先想到的是,你可以确定当前计算机的屏幕

大小如果它大于800x600则通过实例化控件的新字体对象将字体大小增加到

合理级别

像form_load事件一样:


''----------------------------

''为此目的使用Screen Class

For Each ct rl As Control In Me.Controls

如果Screen.PrimaryScreen.Bounds.Height.ToString 600 _

AndAlso Screen.PrimaryScreen.Bounds.Width 800那么

''例如:如果大于800x600,将Button'的字体大小增加到25

ctrl.Font = New Font(Arial,25)

结束如果

下一页

''---------------------------


希望这个有效,


OnurGüzel


10月1日,6日: 54 * pm,kimiraikkonen< kimiraikkone ... @ gmail.comwrote:


10月1日,6:37 * pm,jp2msft< jp2m ... @ discussion.microsoft.comwrote:


在工厂,我们有尺寸范围的显示器,我们强制我们的

应用程序已满屏幕。


屏幕的字体设计用于800x600屏幕,这是我们在这里使用的

最小尺寸分辨率。


但是,每当有人在显示器上运行表格时,分辨率设置为更高(例如1600x1200),文字太小,无法从远处读取。


是否有一种简单的方法可以告诉应用程序适合屏幕宽度

而无需进入每个控件和为他们设置所有字体?


谢谢,

Joe

使用Visual Studio 2005


嗯,首先想到的是,你可以确定当前计算机的屏幕大小是否为b $ b大小,如果它大于800x600则将字体大小增加到

通过在form_load事件中实例化控件的新字体对象

这样的合理级别:


''---- ------------------------

''为此目的使用屏幕类

For Each ctrl As Me.Controls

如果Screen.PrimaryScreen.Bounds.Height.ToString 600 _

AndAlso Screen.PrimaryScreen.Bounds.Width 800那么

''例如:如果大于800x600,将Button'的字体大小增加到25

ctrl.Font = New Font(Arial,25)

结束如果

下一页

''---------------------------


希望这个有效,


OnurGüzel



我想要添加与我之前的帖子相关的内容,但是它也可以增加Form'的字体大小,因为它完成了

它适用于表单上的所有控件,你不会担心由于新的放大字体而导致控件尺寸适合的问题。
>

所以,你也可以考虑:

''------------------------ ----

''为此目的使用屏幕类

如果Screen.PrimaryScreen.Bounds.Height.ToString 600 _

AndAlso Screen .PrimaryScreen.Bounds.Width 800然后

''例如:如果大于800x600,将Button的字体大小增加到20

''引用当前表单实例

Me.Font =新字体(Arial,20)

结束如果

''---------- -----------------


BTW,不要忘记当你增加表格的'字体大小,形式''自己的

大小也会b根据你指定的字体大小值,你需要更大的



OnurGüzel


Hello Joe ,你好Onur,


更改字体大小时,请记住并非所有控件都具有AutoSize功能(例如TextBox控件)。因此,你必须自己改变控件的大小。您还必须相应地重新排列控件,因为标签(具有AutoSize)将会改变它们的大小并破坏您的布局。


>屏幕的字体设计为800x600屏幕,这是我们在这里使用的最小尺寸分辨率。



也许您应该考虑购买可以显示的新显示器

1280x1024。如果您为该分辨率设计了应用程序,那么
对1600x1200没有任何问题。


祝你好运,


Martin


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

解决方案

On Oct 1, 6:37*pm, jp2msft <jp2m...@discussions.microsoft.comwrote:

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


On Oct 1, 6:54*pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:

On Oct 1, 6:37*pm, jp2msft <jp2m...@discussions.microsoft.comwrote:

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

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


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.

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

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


这篇关于比例表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆