Click here to Skip to main content
15,879,239 members
Home / Discussions / C#
   

C#

 
GeneralRe: Knight's tour, recursion, dynamic programming, optimization Pin
trønderen2-Mar-21 8:53
trønderen2-Mar-21 8:53 
QuestionApplication crashes suddenly without any message [Solved] Pin
Alex Dunlop26-Feb-21 22:05
Alex Dunlop26-Feb-21 22:05 
AnswerRe: Application crashes suddenly without any message Pin
BillWoodruff26-Feb-21 22:23
professionalBillWoodruff26-Feb-21 22:23 
GeneralRe: Application crashes suddenly without any message Pin
Alex Dunlop26-Feb-21 22:29
Alex Dunlop26-Feb-21 22:29 
GeneralRe: Application crashes suddenly without any message Pin
OriginalGriff26-Feb-21 22:35
mveOriginalGriff26-Feb-21 22:35 
AnswerRe: Application crashes suddenly without any message Pin
OriginalGriff26-Feb-21 22:32
mveOriginalGriff26-Feb-21 22:32 
GeneralRe: Application crashes suddenly without any message Pin
Alex Dunlop26-Feb-21 23:01
Alex Dunlop26-Feb-21 23:01 
QuestionHow to reset TextBoxes at once? [Solved] Pin
Alex Dunlop25-Feb-21 7:06
Alex Dunlop25-Feb-21 7:06 
Hi,
I have used several TextBoxes and ComboBoxes in my own project. I want to reset TextBoxes at once by pressing a button. I wrote a simple method as follows:
C#
foreach (var c in Controls)
            {
                if (c is TextBox)
                {
                    ((TextBox)c).Clear();
                }
            }

When I run the code, nothing happens. Confused | :confused:
All TextBoxes have their own existing texts.
Please guide me.

modified 26-Feb-21 12:14pm.

AnswerRe: How to reset TextBoxes at once? Pin
Gerry Schmitz25-Feb-21 8:42
mveGerry Schmitz25-Feb-21 8:42 
GeneralRe: How to reset TextBoxes at once? Pin
OriginalGriff25-Feb-21 8:51
mveOriginalGriff25-Feb-21 8:51 
GeneralRe: How to reset TextBoxes at once? Pin
Gerry Schmitz25-Feb-21 9:17
mveGerry Schmitz25-Feb-21 9:17 
AnswerRe: How to reset TextBoxes at once? Pin
OriginalGriff25-Feb-21 8:50
mveOriginalGriff25-Feb-21 8:50 
GeneralRe: How to reset TextBoxes at once? Pin
Alex Dunlop25-Feb-21 19:10
Alex Dunlop25-Feb-21 19:10 
GeneralRe: How to reset TextBoxes at once? Pin
Dave Kreskowiak25-Feb-21 19:44
mveDave Kreskowiak25-Feb-21 19:44 
GeneralRe: How to reset TextBoxes at once? PinPopular
OriginalGriff25-Feb-21 19:59
mveOriginalGriff25-Feb-21 19:59 
GeneralRe: How to reset TextBoxes at once? Pin
Eddy Vluggen26-Feb-21 6:39
professionalEddy Vluggen26-Feb-21 6:39 
GeneralRe: How to reset TextBoxes at once? Pin
BillWoodruff25-Feb-21 21:43
professionalBillWoodruff25-Feb-21 21:43 
AnswerRe: How to reset TextBoxes at once? Pin
Ralf Meier26-Feb-21 3:05
mveRalf Meier26-Feb-21 3:05 
AnswerRe: How to reset TextBoxes at once? Pin
BillWoodruff25-Feb-21 21:36
professionalBillWoodruff25-Feb-21 21:36 
GeneralRe: How to reset TextBoxes at once? Pin
jsc423-Mar-21 0:35
professionaljsc423-Mar-21 0:35 
Questionwhy can we "get away with" creating static Classes outside our Namespace(s) scope (C# language issue) Pin
BillWoodruff25-Feb-21 3:11
professionalBillWoodruff25-Feb-21 3:11 
AnswerRe: why can we "get away with" creating static Classes outside our Namespace(s) scope (C# language issue) Pin
OriginalGriff25-Feb-21 5:32
mveOriginalGriff25-Feb-21 5:32 
GeneralRe: why can we "get away with" creating static Classes outside our Namespace(s) scope (C# language issue) Pin
BillWoodruff25-Feb-21 18:26
professionalBillWoodruff25-Feb-21 18:26 
GeneralRe: why can we "get away with" creating static Classes outside our Namespace(s) scope (C# language issue) Pin
OriginalGriff25-Feb-21 20:04
mveOriginalGriff25-Feb-21 20:04 
GeneralRe: why can we "get away with" creating static Classes outside our Namespace(s) scope (C# language issue) Pin
Richard Deeming25-Feb-21 21:59
mveRichard Deeming25-Feb-21 21:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.