About 10,000,000 results
Open links in new tab
  1. How can I make a reset button in my C# Windows Form?

    Nov 2, 2013 · Either use TryParse as suggested by other answers or place 0 for text boxes used for numeric input in your clear method. Another approach is to use MaskedTextBox for text boxes used for numeric input.

  2. Clear multiple text boxes with a button in C# - Stack Overflow

    Nov 19, 2013 · void ClearAllText(Control con) { foreach (Control c in con.Controls) { if (c is TextBox) ((TextBox)c).Clear(); else ClearAllText(c); } } To use the above code, simply do this: ClearAllText(this);

  3. How to implement a form reset button in ASP.NET Core?

    In your code your are just setting control values to empty strings. You need to also submit the form so that search action will be called with empty search parameters and it will return all the data. document.forms["form"].submit() –

  4. C# clear button | Techist - Tomorrow's Technology Today

    Oct 1, 2008 · In the button click event handler, you need to call the "Clear" method on each text box. You can find the name of each text box by right clicking on it and selecting "Properties" from the context menu.

  5. Control.ControlCollection.Clear Method (System.Windows.Forms)

    The following code example removes all the Control objects in the Control.ControlCollection of the derived class Panel. The example requires that you have created a Panel , a Button , and at least one other control on a Form .

  6. Implementing ButtonTextClear on TextBox WinForms - C#

    One of the top features of mobile apps is the 'x' button on the Textboxes, making it very easy to clear a textbox form. In this post, I'll show you how to implement it by sharing a code made by myself.

  7. clear button code for student registration form in c# - YouTube

    Jun 25, 2016 · Code Link:https://drive.google.com/open?id=0B7WTmbTmp4EfUklBaHFyZXB5Y2MClear or rest button clear all the values in the form. In window form we have to clear...

  8. Reset button to reset contents of textboxes - DaniWeb

    Jan 7, 2014 · you could use a foreach loop to clear all textboxes within a parent control. foreach(Control Control in Form1.Controls) { if(Control is textBox) { (Control as textBox).Clear(); } } If you group together the textbox in a panel/groupbox, pass in the parent control to the loop.

  9. Just trying to create a reset button(c#) how? : r/csharp - Reddit

    Oct 25, 2022 · Make sure any code is properly formatted, explain what you have tried, and where applicable try to create a Minimal, Complete, and Verifiable Example. Be clear and courteous. If a question that could have been easily Googled is asked without indicating what and why those typical results didn't work, it will be removed.

  10. ClearControls - C# - ExtensionMethod.NET

    public static void ClearControls (this System.Windows.Forms.Form form) { foreach (var item in form.Controls) { if (item is TextBox) (item as TextBox).Text = ""; if (item is ComboBox) (item as ComboBox).SelectedIndex = -1; //if (item is ...)} }

Refresh