如何在C#中的两个文本框之间进行驻留 [英] How can I campare between two textboxs in C#

查看:136
本文介绍了如何在C#中的两个文本框之间进行驻留的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户在winform应用程序的textbox1中输入

例如:

> 50

第二步用户将在文本框中输入一个数字2

例如..

用户输入..60

根据textbox1检查textbox2的代码是什么

这将描述我想要的内容

https://www.reduceimages.com/download.php?image=81708eeae1 [ ^ ]



我的尝试:



i是c的初学者#

i只知道如何在两个文本框之间进行操作但是对于操作符来说这对我来说是新的

i want the user to input in textbox1 in winform application
for example :
> 50
second step the user will input a number in textbox 2
For example..
User input ..60
what is the code to check textbox2 according to textbox1
This will describe what i want
https://www.reduceimages.com/download.php?image=81708eeae1[^]

What I have tried:

i am a beginner in c#
i only know how to campare between two textboxs but with operators it is new for me

推荐答案

这是一个非常复杂的操作:您需要将组合输入作为整个语句处理,并将其分解为运算符和操作数,以便将其作为正确的表达式进行评估。



这真的,真的不是一个初学者项目 - 它足够复杂的整篇文章( expression evaluationator c#site:CodeProject.com - Google Search [ ^ ])已经写过关于它们的内容!

这是一个其中:微小的表达评估员 [ ^ ]请注意源下载是78K - 并且代码仅供评估者使用,没有周围的表格代码de使用它的monstarate是3300行代码。 Hello world是4,它让您了解这与初学者项目相比有多复杂,初学者项目最多不超过100行代码。



认真地我会离开这种项目,直到你有更多的经验 - 一个简单的两个文本框和一个组合框将更容易实现更少令人沮丧......
That is a very complex operation: you will need to process the combined inputs as a whole statement, and break it down into operators and operands in order to evaluate it as a "proper expression".

This really, really isn't a "beginner project" - it's complicated enough that whole articles (excpression evaluator c# site:CodeProject.com - Google Search[^]) have been written about them!
Here is one of them: A Tiny Expression Evaluator[^] note that the source download is 78K - and the code just for the evaluator, without the surrounding Form code to demonstarate using it is 3300 lines of code. "Hello world" is 4, which gives you an idea just how complex this is compared to "beginner projects" which rarely exceed 100 lines of code at most.

Seriously, I would leave this kind of project until you have much more experience - a simple "two textboxes and a combobox" would be a lot easier and less frustrating to implement...


这篇关于如何在C#中的两个文本框之间进行驻留的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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