我有一个文本框,我想如果用户输入数字值并单击按钮,则消息框显示文本框值,但用户输入字符值或保持文本框为空,则消息框显示0'零' [英] i have a one textbox and i want to if user enter numric value and click button then messagebox show textbox value but user enter character value or keep textbox blank then messagebox show 0 'zero'

查看:71
本文介绍了我有一个文本框,我想如果用户输入数字值并单击按钮,则消息框显示文本框值,但用户输入字符值或保持文本框为空,则消息框显示0'零'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框,我想如果用户输入数字值并单击按钮,则消息框显示文本框值,但用户输入字符值或将文本框保留为空白,则消息框显示0零"

i have a one textbox and i want to if user enter numric value and click button then messagebox show textbox value but user enter character value or keep textbox blank then messagebox show 0 ''zero''

推荐答案

使用验证来检查在文本框中输入的值是数字还是非数字.如果它不是数字,则显示一个带有0的消息框.
Use a validation to check if the value entered in the text box is numeric or non-numeric. If it non-numeric show a message box with 0 in it.


您还应该考虑不要将完整的问题放在主题行中.有一个用于简短主题的主题行,一个完整的帖子区域,供您完整提问.
You should also consider not putting your full question in the subject line. There''s a subject line provided for a brief subject, and the full post area, for your full question.


这篇关于我有一个文本框,我想如果用户输入数字值并单击按钮,则消息框显示文本框值,但用户输入字符值或保持文本框为空,则消息框显示0'零'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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