//确定按钮 private void btnOk_Click(object sender, EventArgs e) { double totalPrices = 0d; //传进下拉选择值和原价,计算实际收费结果 totalPrices = cf.GetFactTotal(cbxType.SelectedItem.ToString(), Convert.ToDouble(txtPrice.Text) * Convert.ToDouble(txtNum.Text)); total = total + totalPrices; lbxList.Items.Add("单价:" + txtPrice.Text + " 数量:" + txtNum.Text + " " + cbxType.SelectedItem + " 合计: " + totalPrices.ToString()); lblResult.Text = total.ToString(); }