Results 1 to 2 of 2
  1. #1
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed

    Question forthis instead of foreach

    hi

    jorndel already gave me this code:

    Code:
     foreach (Control C in this.Controls)
                {
                    if (C is CheckBox)
                    {
                        CheckBox CheckBoxC = C as CheckBox;
                        if (CheckBoxC.Checked)
                        {
                            int Che = int.Parse(CheckBoxC.Name.Replace("checkBox", ""));
                        }
                     }
                 }
    but this was to overrun all checkboxes in the form, can i do something like forthis (Control C in this.Controls) ?
    so i just have the value of the checkbox i just changed (i don't mind to manualy add an integer if nescecary

    thx

  2. #2
    Eidolon's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Vanished
    Posts
    822
    Reputation
    54
    Thanks
    4,034
    My Mood
    Angelic
    MSDN Library
    Find your answer here... Its the wiki of microsoft's programming langs.




    Yet, you are a pathetic human.

    Contributor since: 7.26.2012 - ended
    Donator since: 7.14.2012


Similar Threads

  1. 2 Primary Weapons instead of Special Granade
    By 47Z3 in forum Call of Duty Modern Warfare 2 Help
    Replies: 3
    Last Post: 01-26-2010, 04:43 PM
  2. Replies: 12
    Last Post: 07-20-2009, 06:43 PM
  3. What to use instead of Winrar (not advertising, just suggestion)
    By sharkzfan in forum Combat Arms Hacks & Cheats
    Replies: 7
    Last Post: 07-20-2009, 12:51 PM
  4. Save Energy ~ Use Neroogle instead of Google
    By Silk[H4x] in forum Programming Tutorials
    Replies: 1
    Last Post: 08-18-2008, 02:25 PM
  5. How to bypass Xtrap ? Then Use Actool instead of KoxP !
    By kcetinkaya in forum Knight Online Hacks
    Replies: 2
    Last Post: 07-18-2007, 08:01 PM