如何使一个文本框等于多个其他文本框并显示一条消息 [英] How to make one Textbox be equal to multiple other textboxes and show a message

查看:105
本文介绍了如何使一个文本框等于多个其他文本框并显示一条消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果TextBox10.Text = TextBox11.Text和TextBox12.Text和TextBox13.Text和TextBox14.Text和TextBox15.Text和TextBox16.Text和TextBox17.Text然后是
            Label4.Text ="Good Work"&b
       否则

            Label4.Text ="再试一次"

       结束如果

If TextBox10.Text = TextBox11.Text And TextBox12.Text And TextBox13.Text And TextBox14.Text And TextBox15.Text And TextBox16.Text And TextBox17.Text Then
            Label4.Text = "Good Work"
        Else
            Label4.Text = "Try Again"
        End If

此代码对我不起作用,因为即使是Textbox10.Text也不等于Textbox12.text但等于Textbox11.Text然后它仍然会显示"Good job"而不是"再试一次"但我需要它,以便Textbox10.Text等于所有
其他文本框以显示好的工作,否则显示再试一次。

This code does not work for me because even is Textbox10.Text does not equal Textbox12.text but is equal to Textbox11.Text then it will still display "Good job" instead of "Try again" but I need it so that Textbox10.Text equals all of the other Textboxes in order to show good work otherwise show try again.

推荐答案

尝试对所有人使用equals。

Try using equals for all.

事件然后可能存在数字和残障问题。

Event then there may be problem cases with numbers and invalids.

即TextBox10.Text = TextBox12.Text

ie TextBox10.Text = TextBox12.Text

如果你用每个单独的语句编写它们,你可以通过它们调试单步,看看哪些不起作用。

Ps if you make it up with individual statements for each, you can debug single step through them as see what one is not working.

即如果TextBox10.Text = TextBox11.Text那么

ie if TextBox10.Text = TextBox11.Text then

         if TextBox10.Text = TextBox12.Text

        if TextBox10.Text = TextBox12.Text

现在,您可以查看每一行,看看发生了什么。一旦它工作,你想要一次一个地组合它们并检查每一个。

now you can look at each line to see what is going on. Once it works how you want combine them one at a time and check each one.

我认为当你不使用equals时它会计算为布尔值true或false还是什么?

I think when you don't use the equals it evaluates to Boolean true or false or something?


这篇关于如何使一个文本框等于多个其他文本框并显示一条消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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