Click here to Skip to main content
15,908,906 members
Home / Discussions / C#
   

C#

 
QuestionLifetime for server activated singleton? Pin
devvvy19-Aug-03 21:31
devvvy19-Aug-03 21:31 
AnswerRe: Lifetime for server activated singleton? Pin
James T. Johnson19-Aug-03 22:23
James T. Johnson19-Aug-03 22:23 
GeneralRe: Lifetime for server activated singleton? Pin
Philip Fitzsimons20-Aug-03 2:47
Philip Fitzsimons20-Aug-03 2:47 
GeneralPosting Forms Pin
Meysam Mahfouzi19-Aug-03 18:29
Meysam Mahfouzi19-Aug-03 18:29 
GeneralRe: Posting Forms Pin
xoph21-Aug-03 0:38
xoph21-Aug-03 0:38 
GeneralRe: Posting Forms Pin
Meysam Mahfouzi21-Aug-03 19:51
Meysam Mahfouzi21-Aug-03 19:51 
GeneralRe: Posting Forms Pin
xoph23-Aug-03 0:42
xoph23-Aug-03 0:42 
GeneralRe: Posting Forms Pin
Meysam Mahfouzi23-Aug-03 16:56
Meysam Mahfouzi23-Aug-03 16:56 
GeneralRegular Expression query Pin
Nish Nishant19-Aug-03 18:10
sitebuilderNish Nishant19-Aug-03 18:10 
GeneralRe: Regular Expression query Pin
Nish Nishant19-Aug-03 18:18
sitebuilderNish Nishant19-Aug-03 18:18 
GeneralRe: Regular Expression query Pin
Nick Parker19-Aug-03 18:36
protectorNick Parker19-Aug-03 18:36 
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 

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.