You can do it as follows:
txtUnitTotalQty.Text = txtPrice.Text = txtUnitPrice.Text = lblTotalvalue.Text = string.Empty;
Or you can write a method for it:
public void SetText(params TextBox[] controls, string text) { foreach(var ctrl in controls) { ctrl.Text = text; } }
Using this will:
SetText(txtUnitTotalQty, txtPrice, txtUnitPrice, lblTotalvalue, string.Empty);
Simon karlsson
source share