System.Drawing中。字体错误 - emsize为零 [英] System.Drawing. Font error - emsize is Zero

查看:471
本文介绍了System.Drawing中。字体错误 - emsize为零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的程序要求用户输入一个号码。这个数字,存储为String,然后转换为Single值并存储在单个变量x中。

My program requests the user to enter a number. This number, stored as String, is then converted to a Single value and stored in a Single variable, x.

然后使用此x在下面:

objFont = New System.Drawing.Font (" Arial",x,FontStyle.Bold)

objFont = New System.Drawing.Font("Arial", x, FontStyle.Bold)

 

当我编译时,我得到错误"值'0'对'emSize'无效。 'emSize'应大于0 .....参数名称:emSize。

When I compile, I get the error "Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0.....parameter name: emSize.

参数为100.

似乎是什么问题?

推荐答案


当我编译时,我得到了错误"'0'的值对'emSize'无效。 'emSize'应大于0 .....参数名称:emSize。

When I compile, I get the error "Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0.....parameter name: emSize.

您如何确定参数为100?     ;例如,当您在该行插入断点并运行代码并且命中断点时,'x'的值是多少?

How have you determined that the parameter is 100?   For instance, when you insert a breakpoint at that line and run your code and the breakpoint is hit, what is the value of 'x'?


这篇关于System.Drawing中。字体错误 - emsize为零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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