How To Clear Input Fields (TextBox, Radio Buttons, Check Box, Combobox, Picturebox) On Button Click In C# Windows Application

How To Clear Input Fields (TextBox, Radio Buttons, Check Box, Combobox, Picturebox) On Button Click In C# Windows Application

How To Clear Input Fields (TextBox,Radio Buttons, Check Box, Combobox,Picturebox) On Button Click In C# Windows Application
How To Clear Input Fields (TextBox,Radio Buttons, Check Box, Combobox,Picturebox) On Button Click In C# Windows Application
How To Clear Input Fields (TextBox,Radio Buttons, Check Box, Combobox,Picturebox) On Button Click In C# Windows Application

This Tutorial Shows How To Clear Input Fields(TextBox,Radio Buttons, Check Box, Combobox,Picturebox) On Button Click In C# Windows Application.

Whats covered in this guide :
How To Clear Picturebox In C#
How To Clear Radio Button Selection In C#
How To Clear Textbox In C#
How To Clear Checkbox In C#

C# SOURCE CODE

        public void clearInputFields()
        {
            //Clearing Textboxes
            textBoxFirstName.Text = String.Empty;
            textBoxLastName.Text = String.Empty;
            textBoxImagePath.Text = String.Empty;
            //Clearing Radio Buttons
            radioButtonGenderMale.Checked = false;
            radioButtonGenderFemale.Checked = false;
            //Clearing ComboBoxes
            //comboBoxCountry.Items.Clear();
            comboBoxCountry.SelectedIndex = -1;
            //Clearing PictureBox
            pictureBox1.Image = null;

            MessageBox.Show("Fields Cleared");
        }

Leave a Reply

Your email address will not be published. Required fields are marked *