如何在C#
中执行此操作if txtbxquantity.text <=5
then
txtbxhighlowitem.text = low item
else
txtbxhighlowitem.text = high item
end if
答案 0 :(得分:1)
可能你想做下一个:
int lowitem=0;
int highitem=0;
if(Convert.ToInt32(txtbxquantity.Text)<=5)
lowitem = Covnert.ToInt32(txtbxhighlowitem.Text);
else
highitem = Covnert.ToInt32(txtbxhighlowitem.Text);
或
private void button1_Click(object sender, EventArgs e)
{
string lowitem = "low item";
string highitem = "high item";
if (Convert.ToInt32(txtbxquantity.Text) <= 5)
txtbxhighlowitem.Text = lowitem;
else
txtbxhighlowitem.Text = highitem;
}
答案 1 :(得分:0)
if (txtbxquantity.Text <= "5")
{
txtbxhighlowitem.Text = "low item";
}
else
{
txtbxhighlowitem.Text = "high item";
}