Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Regular Expression query Pin
Nish Nishant19-Aug-03 18:44
sitebuilderNish Nishant19-Aug-03 18:44 
GeneralRe: Regular Expression query Pin
Nick Parker19-Aug-03 18:49
protectorNick Parker19-Aug-03 18:49 
GeneralRe: Regular Expression query Pin
Nish Nishant19-Aug-03 19:06
sitebuilderNish Nishant19-Aug-03 19:06 
GeneralRe: Regular Expression query Pin
Nish Nishant19-Aug-03 18:41
sitebuilderNish Nishant19-Aug-03 18:41 
GeneralRe: Regular Expression query Pin
Philip Fitzsimons20-Aug-03 2:51
Philip Fitzsimons20-Aug-03 2:51 
QuestionHow would I implement this? Pin
deanoA19-Aug-03 17:07
deanoA19-Aug-03 17:07 
AnswerRe: How would I implement this? Pin
Nick Parker19-Aug-03 17:37
protectorNick Parker19-Aug-03 17:37 
GeneralRe: How would I implement this? Pin
Frank Olorin Rizzi20-Aug-03 1:54
Frank Olorin Rizzi20-Aug-03 1:54 
Nick Parker wrote:
ControlCollection col = (ControlCollection)this.Controls;foreach(Control t in col){ if(t is TextBox) { if(t.Text != String.Empty) { // Do something here. break; } }}


Hmmm...
I can't help myself....

1~ he wanted to stop as soon as one text box had no text (actually he mentioned only the first text box, but I'll assume it was an example).
Thus
<br />
//...<br />
    if(t.Text == String.Empty)  break;<br />
//...<br />


Also, why not keep your own collection of controls containing only the text boxes so that you would not have to parse through all of the controls in the form?

Actually, since they are all text boxes, make it a collection of text boxes...

So, when you add them to the form's Controls in your initializer, also add them to myBoxes;
then:

<br />
foreach(TextBox t in myBoxes)<br />
{<br />
  if(t.Text == String.Empty)  break;<br />
  //Do whatever you need here...<br />
}<br />



HTH,
F.O.R.
GeneralRe: How would I implement this? Pin
Nick Parker20-Aug-03 2:16
protectorNick Parker20-Aug-03 2:16 
GeneralRe: How would I implement this? Pin
Roland Bär20-Aug-03 2:25
Roland Bär20-Aug-03 2:25 
GeneralRe: How would I implement this? Pin
Nick Parker20-Aug-03 2:58
protectorNick Parker20-Aug-03 2:58 
GeneralRe: How would I implement this? Pin
Roland Bär20-Aug-03 3:05
Roland Bär20-Aug-03 3:05 
GeneralRe: How would I implement this? Pin
Nick Parker20-Aug-03 3:23
protectorNick Parker20-Aug-03 3:23 
GeneralRe: How would I implement this? Pin
Frank Olorin Rizzi20-Aug-03 2:41
Frank Olorin Rizzi20-Aug-03 2:41 
GeneralRe: How would I implement this? Pin
Nick Parker20-Aug-03 3:28
protectorNick Parker20-Aug-03 3:28 
GeneralRe: How would I implement this? Pin
Philip Fitzsimons20-Aug-03 3:00
Philip Fitzsimons20-Aug-03 3:00 
GeneralRe: How would I implement this? Pin
Nick Parker20-Aug-03 3:02
protectorNick Parker20-Aug-03 3:02 
GeneralRe: How would I implement this? Pin
Philip Fitzsimons20-Aug-03 3:08
Philip Fitzsimons20-Aug-03 3:08 
GeneralRe: How would I implement this? Pin
Nick Parker20-Aug-03 3:25
protectorNick Parker20-Aug-03 3:25 
GeneralRe: How would I implement this? Pin
Philip Fitzsimons20-Aug-03 4:42
Philip Fitzsimons20-Aug-03 4:42 
GeneralRe: How would I implement this? Pin
Nick Parker20-Aug-03 4:53
protectorNick Parker20-Aug-03 4:53 
GeneralRe: How would I implement this? Pin
Philip Fitzsimons20-Aug-03 5:07
Philip Fitzsimons20-Aug-03 5:07 
General.net remoting and business objects Pin
Member 9619-Aug-03 16:43
Member 9619-Aug-03 16:43 
GeneralRe: .net remoting and business objects Pin
Carl Mercier19-Aug-03 17:06
Carl Mercier19-Aug-03 17:06 
GeneralRe: .net remoting and business objects Pin
Member 9619-Aug-03 19:54
Member 9619-Aug-03 19:54 

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.