Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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 = "";
Comment

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);
 }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# edit element in list 
Csharp :: c# return task list 
Csharp :: c# if statement 
Csharp :: valid URL check in c# 
Csharp :: all possible substrings of a string 
Csharp :: list search c# 
Csharp :: convert xml string to file c# 
Csharp :: adding values to mock IHttpContextAccessor unit test .net core 
Csharp :: NameValueCollection 
Csharp :: checking if character is a digit or not in c# 
Csharp :: c# get certain character from string 
Csharp :: unity gui text 
Csharp :: add a dictionary to another dictionary c# 
Csharp :: convert object to httpcontent c# 
Csharp :: exceldatareader example c# 
Csharp :: asp.net core miniprofiler 
Csharp :: bundle.config in mvc is missing 
Csharp :: unity camera follow with lerp 
Csharp :: unity c# change animation 
Csharp :: solid principles c# 
Csharp :: c# string to int 
Csharp :: how to upload an image to an image source c# 
Csharp :: export list to excel c# 
Csharp :: c# implement ienumerable t 
Csharp :: assembly project name c# .net 
Csharp :: vb.net remove last comma from string 
Csharp :: C# actions 
Csharp :: how to reload app.config file at runtime in c# 
Csharp :: c# chunk array 
Csharp :: c# modulo 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =