帮助实现逻辑 [英] Help need in implementing logic

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

问题描述





我是C#编程的新手。我正在从应用程序窗口创建GUI。我想根据三个属性估计传入的数量。我能够获得这些属性。用户可以使用任何一个属性或所有三个属性来估计传入的数量。这三个属性是

1)温度

2)压力

3)密度

所以我创建了支票每个房产的盒子。当我打勾复选框然后我将使用该属性来估计传入的财产。

我有这样的条件

1)温度是30到 60,压力为100至300,密度为0至0.4,则为气体。

2)温度为60至90,压力为300至600 和密度0.4到1.4然后是液体。

3)温度为90至120,压力为600至900,密度为1.4至3它是水。



但是用户可以使用任何一个属性或以上三个属性进行估算。例如,如果用户只使用温度,那么我需要使用该属性,并根据我必须估计。如果用户想要使用所有临时,按,密度,那么我需要使用所有属性,如果一切都是真的,则显示传入的数量。



我试过上传我的Windows窗体图像,但我无法在此网站上传。我不知道如何上传。所以帮助我如何实现这个概念。

Hi,

I am very new to C# programming. I am creating GUI in windows from application.I want to estimate the incoming quantity based on three properties. I am able to get those properties. User can use any one of the property or all three properties to estimate the incoming quantity. The three properties are
1) Temperature
2) Pressure
3) Density
So i have created check box''s for each property. when i tick the check box then i am going to use that property to estimate incoming property.
I have the conditions like this
1) Temperature is "30" to "60" and pressure is "100 to 300" and density "0 to 0.4" then it is "gas".
2) Temperature is "60" to "90" and pressure is "300 to 600" and density "0.4 to 1.4" then it is "liquid".
3) Temperature is "90" to "120" and pressure is "600 to 900" and density "1.4 to 3" then it is "water".

But the thing is user can use any one of the property or all above three properties to estimate. for example if user use only temperature then i need to use that property and based on that i have to estimate. if user wants to use all "temp, press, density" then i need to use all properties and if all is true then display the incoming quantity.

I have tried to upload my windows form images but i am not able to upload on this site. i don''t know how to upload. so help me how to implement this concept.

推荐答案

而不是使用复选框,你可以使用滚动条。

你可以设置最大值最小值。



因此TempratureScrollBar可以设置为最小30和最大120.同样

pressureScrollBar可以是100和900在您的情况下

但这些最小值和最大值只能是整数 - 因此对于密度,您可以通过将100乘以实际值来设置这些限制,并且在读取值时可以再次将其除以100。



这些滚动条将始终设置为某个值,因此您不会遇到任何这些值不可用的情况。



如果这对你没有帮助,那么你可能需要先了解这个要求并相应地引入更多条件。



在MSDN上,您可以看到Windows的ScrollBar控件
Instead of using check box you can use scroll bars.
You can set the Maximum and Minimum values for that.

So the TempratureScrollBar can be set like Minimum 30 and Maximum 120. similarly
the pressureScrollBar can be 100 and 900 in your case
But these Minimum and Maximum can be only integers - so for density you can set these limits by multiplying 100 to actual value and while reading the value you can divide that by 100 again.

These scrollbars will always be set to some value so you will not encounter a situation where any of these values are not available.

If this doesn''t help you then probably you have to understand the requirement first and introduce more conditions accordingly.

Here on MSDN you can see ScrollBar controls for windows


这篇关于帮助实现逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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