Click here to Skip to main content
15,912,837 members
Home / Discussions / C#
   

C#

 
AnswerRe: Nightmare StreamReader! Pin
Bekjong21-May-07 5:26
Bekjong21-May-07 5:26 
AnswerRe: Nightmare StreamReader! Pin
Dave Herren21-May-07 5:45
Dave Herren21-May-07 5:45 
AnswerRe: Nightmare StreamReader! Pin
jayart21-May-07 6:29
jayart21-May-07 6:29 
AnswerRe: Nightmare StreamReader! Pin
Dave Kreskowiak21-May-07 6:31
mveDave Kreskowiak21-May-07 6:31 
QuestionAdding and Removing Form Controls Using Code Pin
Joseph Stanish21-May-07 4:27
Joseph Stanish21-May-07 4:27 
AnswerRe: Adding and Removing Form Controls Using Code Pin
Guffa21-May-07 4:30
Guffa21-May-07 4:30 
GeneralRe: Adding and Removing Form Controls Using Code Pin
Joseph Stanish21-May-07 4:36
Joseph Stanish21-May-07 4:36 
AnswerRe: Adding and Removing Form Controls Using Code Pin
Bekjong21-May-07 4:41
Bekjong21-May-07 4:41 
What's so hard about iterating through your controls? If you can add the pro grammatically it's just as easy to remove them, isn't it? Confused | :confused:

this.SuspendLayout();
Collection<Control> temp = new Collection<Control>();
foreach (Control c in this.Controls)
{
    if (c.GetType() == typeof(TextBox) && c.Tag == "drop me") // or any other condition
    {
        temp.Add(c);
    }
}
foreach (Control c in temp)
{
    this.Controls.Remove(c);
    c.Dispose();
}
temp = null;
this.ResumeLayout();



Standards are great! Everybody should have one!

GeneralRe: Adding and Removing Form Controls Using Code Pin
Joseph Stanish21-May-07 4:42
Joseph Stanish21-May-07 4:42 
GeneralRe: Adding and Removing Form Controls Using Code Pin
Martin#21-May-07 4:51
Martin#21-May-07 4:51 
GeneralRe: Adding and Removing Form Controls Using Code Pin
Luc Pattyn21-May-07 8:50
sitebuilderLuc Pattyn21-May-07 8:50 
AnswerRe: Adding and Removing Form Controls Programatically Pin
Marc Clifton21-May-07 4:28
mvaMarc Clifton21-May-07 4:28 
GeneralRe: Adding and Removing Form Controls Programatically Pin
Joseph Stanish21-May-07 4:29
Joseph Stanish21-May-07 4:29 
GeneralRe: Adding and Removing Form Controls Programatically Pin
Martin#21-May-07 4:31
Martin#21-May-07 4:31 
GeneralRe: Adding and Removing Form Controls Programatically Pin
Joseph Stanish21-May-07 4:39
Joseph Stanish21-May-07 4:39 
GeneralRe: Adding and Removing Form Controls Programatically Pin
Martin#21-May-07 4:45
Martin#21-May-07 4:45 
GeneralRe: Adding and Removing Form Controls Programatically Pin
Marc Clifton21-May-07 5:05
mvaMarc Clifton21-May-07 5:05 
QuestionChange Locked property Pin
Tushar Mahajan21-May-07 3:17
Tushar Mahajan21-May-07 3:17 
AnswerRe: Change Locked property Pin
Manoj Kumar Rai21-May-07 3:38
professionalManoj Kumar Rai21-May-07 3:38 
GeneralRe: Change Locked property Pin
Tushar Mahajan21-May-07 3:46
Tushar Mahajan21-May-07 3:46 
GeneralRe: Change Locked property Pin
Martin#21-May-07 4:33
Martin#21-May-07 4:33 
GeneralRe: Change Locked property Pin
Tushar Mahajan21-May-07 18:55
Tushar Mahajan21-May-07 18:55 
AnswerRe: Change Locked property Pin
Martin#21-May-07 3:41
Martin#21-May-07 3:41 
QuestionApplication Error---Any help please?? Pin
Ntoki21-May-07 2:55
Ntoki21-May-07 2:55 
AnswerRe: Application Error---Any help please?? Pin
Guffa21-May-07 3:00
Guffa21-May-07 3:00 

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.