处理空字段 [英] Handling empty fields

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

问题描述

您好。我正在使用Visual Studio .NET(学术版)编写一个VB

程序。我的电脑正在运行Win XP Pro。


我正在写一个计算器并要求用户输入两个数字。在输入数字后,他们应该点击一个名为'显示结果''的按钮。

我如何显示一个对话框,提示用户检查他们的输入是否

他们把任何一个盒子留空了?我已经尝试了.IsNaN功能但是在

静脉中。


谢谢。

-

Xero

http://www.chezjeff.net

我的个人门户网站

Hello. I am using Visual Studio .NET (Academic Edition) to write a VB
program. My computer is running Win XP Pro.

I am writing a calculator and requires users to enter two numbers. After
entering the numbers, they should click a button called ''Display Results''.
How can I display a dialog box prompting the users to check their entry if
they left any of the boxes empty? I have tried the .IsNaN function but in
vein.

Thanks.
--
Xero

http://www.chezjeff.net
My personal web portal

推荐答案




检查是否为isnumeric( textbox.text)

或你可以检查的长度textbox.text.length> 0

或将它们合并


hth

Peter

" Xero" <杰夫@ chezjeff(删除).NET>在消息中写道

新闻:F8 ********************************** @ microsof t.com ...
Hi,

check if isnumeric(textbox.text)
or for the length you could check textbox.text.length > 0
or combine them

hth
Peter
"Xero" <jeff@chezjeff(REMOVE).net> wrote in message
news:F8**********************************@microsof t.com...
你好。我正在使用Visual Studio .NET(学术版)编写VB
程序。我的电脑正在运行Win XP Pro。

我正在写一个计算器,要求用户输入两个数字。在输入数字后,他们应该点击一个名为显示结果的按钮。
如何显示一个对话框,提示用户检查他们的输入是否他们离开了任何一个盒子空了?我已经尝试过了.IsNaN功能,但是很好。

谢谢。
-
Xero

http://www.chezjeff.net
我的个人门户网站
Hello. I am using Visual Studio .NET (Academic Edition) to write a VB
program. My computer is running Win XP Pro.

I am writing a calculator and requires users to enter two numbers. After
entering the numbers, they should click a button called ''Display Results''.
How can I display a dialog box prompting the users to check their entry if
they left any of the boxes empty? I have tried the .IsNaN function but in
vein.

Thanks.
--
Xero

http://www.chezjeff.net
My personal web portal



Xero,


显示Peters动作的结果,而不是

messagebox.show("你应该输入一些东西)


我希望这有帮助吗?


Cor

" Xero" < jeff @ chezjeff(REMOVE).net>

....
Xero,

To show the result from Peters actions when not
messagebox.show("You should enter something")

I hope this helps?

Cor
"Xero" <jeff@chezjeff(REMOVE).net>
....
你好。我正在使用Visual Studio .NET(学术版)编写VB
程序。我的电脑正在运行Win XP Pro。

我正在写一个计算器,要求用户输入两个数字。在输入数字后,他们应该点击一个名为显示结果的按钮。
如何显示一个对话框,提示用户检查他们的输入是否他们离开了任何一个盒子空了?我已经尝试过了.IsNaN功能,但是很好。

谢谢。
-
Xero

http://www.chezjeff.net
我的个人门户网站
Hello. I am using Visual Studio .NET (Academic Edition) to write a VB
program. My computer is running Win XP Pro.

I am writing a calculator and requires users to enter two numbers. After
entering the numbers, they should click a button called ''Display Results''.
How can I display a dialog box prompting the users to check their entry if
they left any of the boxes empty? I have tried the .IsNaN function but in
vein.

Thanks.
--
Xero

http://www.chezjeff.net
My personal web portal



我明白了。非常感谢。


" Peter Proost"写道:
I see. Thanks very much.

"Peter Proost" wrote:


检查是否是isnumeric(textbox.text)
或长度你可以检查textbox.text.length> 0



彼得
Xero <杰夫@ chezjeff(删除).NET>在消息中写道
新闻:F8 ********************************** @ microsof t.com。 ..
Hi,

check if isnumeric(textbox.text)
or for the length you could check textbox.text.length > 0
or combine them

hth
Peter
"Xero" <jeff@chezjeff(REMOVE).net> wrote in message
news:F8**********************************@microsof t.com...
你好。我正在使用Visual Studio .NET(学术版)编写VB
程序。我的电脑正在运行Win XP Pro。

我正在写一个计算器,要求用户输入两个数字。在输入数字后,他们应该点击一个名为显示结果的按钮。
如何显示一个对话框,提示用户检查他们的输入是否他们离开了任何一个盒子空了?我已经尝试过了.IsNaN功能,但是很好。

谢谢。
-
Xero

http://www.chezjeff.net
我的个人门户网站
Hello. I am using Visual Studio .NET (Academic Edition) to write a VB
program. My computer is running Win XP Pro.

I am writing a calculator and requires users to enter two numbers. After
entering the numbers, they should click a button called ''Display Results''.
How can I display a dialog box prompting the users to check their entry if
they left any of the boxes empty? I have tried the .IsNaN function but in
vein.

Thanks.
--
Xero

http://www.chezjeff.net
My personal web portal




这篇关于处理空字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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