how to give same property to all textboxes present in the same form.
foreach (var textbox in this.Controls.OfType()) { t
private void SetProperty(Control ctr) { foreach(Control control in ctr.Controls) { if (control is TextBox) { control.ContextMenu = new ContextMenu(); } else { if (control.HasChildren) { SetProperty(control); } } } }