c#question我的firsttextvaue已经填满1000,如果我想做第二个文本框值不大于第一个文本值。 [英] c# question my firsttextvaue already fill 1000 and if i want to do second textbox value is not greater than first text value.

查看:109
本文介绍了c#question我的firsttextvaue已经填满1000,如果我想做第二个文本框值不大于第一个文本值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请在C#中编写代码,如果我管理文本框属性

Write the code in C# please if i manage the textbox property

推荐答案



为此你应该Comapre的值为 textBox2 textBox2_textChanged()事件
textBox1 />


ex。

Hi,
For this you should Comapre the value of textBox2 with textBox1 in the textBox2_textChanged() event

ex.
textBox2_textChanged(Object sender, Eventargs e)
{
     int a=int.parse(textBox1.text);
     if (textBox1.Text > a)
     {
      MessageBox.Show("You cannot enter value greater than {0}", a);
     }
}





谢谢。



Thanks.


这篇关于c#question我的firsttextvaue已经填满1000,如果我想做第二个文本框值不大于第一个文本值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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