111,110
社区成员




private void AllCount()
{
foreach (string num in txbAllWater.Lines)
{
x = Convert.ToDouble(num);
if (x < 0)
{
lisBoxAllMoney.Items.Add("用水量:" + x + " 立方米," + "用水量不可能小于0!");
}
else if (x >= 0 && x <= 22)
{
y = 1.9 * x + 0.9 * x * 0.9;
lisBoxAllMoney.Items.Add("用水量:" + x + " 立方米," + "应缴水费:" + y.ToString() + " 元");
}
/*else...*/
}
}
private void txbAllWater_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 && e.KeyChar != 13 && e.KeyChar != 45 && e.KeyChar != 46)
{
e.Handled = true;
}
}