Answers for "c# clear all textboxes"

C#
2

c# clear a textbox

// Method 1: Use clear method
Textbox.clear();
// Method 2: Set text to string.Empty
Textbox.Text = string. Empty;
// Method 3: Set text to blank
Textbox.Text = "";
Posted by: Guest on June-11-2021
0

c# clear all textboxes

private void ClearTextBoxes()
 {
     Action<Control.ControlCollection> func = null;

     func = (controls) =>
         {
             foreach (Control control in controls)
                 if (control is TextBox)
                     (control as TextBox).Clear();
                 else
                     func(control.Controls);
         };

     func(Controls);
 }
Posted by: Guest on November-04-2020

C# Answers by Framework

Browse Popular Code Answers by Language