Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 39
  1. #16
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,540
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    sorry for double post

    this code doesn't do anything, i check 1 checkbox (1st one) and this code:

    Code:
      private void button2_Click(object sender, EventArgs e)
            {
               int Loops = 0;
                foreach (Control C in this.Controls)
                {
                    if (C is CheckBox)
                    {
                        CheckBox CheckBoxC = C as CheckBox;
                        if (CheckBoxC.Checked)
                        {
                            if(Loops >= 0 & Loops <= 17)
                                {
                                    MessageBox.Show("between 0 and 17");
                                }
                            if(Loops >= 18 & Loops <= 35)
                                {
                                    MessageBox.Show("between 18 and 35");
                                }
                        }
                        Loops++;
                    }
                }
    and it doesn't do anything when any of those checkboxes is checked and i click the button
    Are you sure you search the right controls?
    So you don't use like a TabControl* | panel or such?

    ______________
    Form1:

    Code:
    Code:
    private void button1_Click(object sender, EventArgs e)
            {
                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", ""));
                            if (Che >= 0 & Che <= 5)
                            {
                                MessageBox.Show("between 0 and 5");
                            }
                            if (Che >= 6 & Che <= 11)
                            {
                                MessageBox.Show("between 6 and 11");
                            }
                        }
                    }
                }
            }
    I use the Replacing of the Default Name to ensure I get the right checbox.
    I know it go from the last control sometimes. (Total random :P)

    If you have it on a panel do so:
    Code:
     foreach (Control C in panel1.Controls)
    Last edited by Jorndel; 08-11-2012 at 11:05 AM.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  2. #17
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed
    Quote Originally Posted by Jorndel View Post


    Are you sure you search the right controls?
    So you don't use like a TabControl* | panel or such?

    ______________
    Form1:

    Code:
    Code:
    private void button1_Click(object sender, EventArgs e)
            {
                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", ""));
                            if (Che >= 0 & Che <= 5)
                            {
                                MessageBox.Show("between 0 and 5");
                            }
                            if (Che >= 6 & Che <= 11)
                            {
                                MessageBox.Show("between 6 and 11");
                            }
                        }
                    }
                }
            }
    I use the Replacing of the Default Name to ensure I get the right checbox.
    I know it go from the last control sometimes. (Total random :P)

    If you have it on a panel do so:
    Code:
     foreach (Control C in panel1.Controls)
    what do you mean with panel?
    a combbox? Cause i have 18 combob.oxes with 5 checkboxes in each and check1 is first of combo1 and check 2 is first of combo2...

  3. #18
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,540
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    what do you mean with panel?
    a combbox? Cause i have 18 combob.oxes with 5 checkboxes in each and check1 is first of combo1 and check 2 is first of combo2...
    You talk about this?

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  4. #19
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed
    Quote Originally Posted by Jorndel View Post


    You talk about this?
    sorry, actually maent groupbox

  5. #20
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,540
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    sorry, actually maent groupbox
    Then you just do:
    Code:
     foreach (Control C in groupBox1.Controls)
    Change the number of the Groupbox using.
    Or the NAME of it...
    And it will check all the controls in that.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  6. #21
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed
    Quote Originally Posted by Jorndel View Post


    Then you just do:
    Code:
     foreach (Control C in groupBox1.Controls)
    Change the number of the Groupbox using.
    Or the NAME of it...
    And it will check all the controls in that.
    But that's the problem, 1-19-37-55-73 are in group1 2,20,38,56,74 are in group2 etc etc

    And i have to check them from 1 to 2 to 3 etc

  7. #22
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,540
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    But that's the problem, 1-19-37-55-73 are in group1 2,20,38,56,74 are in group2 etc etc

    And i have to check them from 1 to 2 to 3 etc
    Then you just run more scans then :|
    And change the groupbox....

    And use the checking of the name to check the "index" of the checkbox...

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  8. #23
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,751
    Reputation
    66
    Thanks
    14,310
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    But that's the problem, 1-19-37-55-73 are in group1 2,20,38,56,74 are in group2 etc etc

    And i have to check them from 1 to 2 to 3 etc
    Then create a loop to go thru the groupBoxes, and inside this loop, another loop to search thru the Checkboxes of each group.. not that hard


    CoD Minion from 09/19/2012 to 01/10/2013

  9. #24
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed
    Ok, thx, i'm allready thinking an will write it asap on my pc, don't feel like writing it right now xd cause that would be on paper

  10. #25
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed
    ok, if i do this:

    Code:
            private void button1_Click(object sender, EventArgs e)
            {
                string lol = "";
                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", ""));
                            if (Che == 1)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 2)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 3)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 4)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 5)
                            {
                                lol = lol + Che.ToString();
                            }
                        }
                    }
                }
                MessageBox.Show(lol);
            }
    and i use 5 checkboxes and 1 button, it results that it begins with 5 anyway, so if i select all 5 boxes it shows 54321 and if i do 4 and 2 it show 42 so it goes from big to small... but i don't think that's a problem so thanks anyway Jorndel

  11. #26
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,540
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    ok, if i do this:

    Code:
            private void button1_Click(object sender, EventArgs e)
            {
                string lol = "";
                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", ""));
                            if (Che == 1)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 2)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 3)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 4)
                            {
                                lol = lol + Che.ToString();
                            }
                            if (Che == 5)
                            {
                                lol = lol + Che.ToString();
                            }
                        }
                    }
                }
                MessageBox.Show(lol);
            }
    and i use 5 checkboxes and 1 button, it results that it begins with 5 anyway, so if i select all 5 boxes it shows 54321 and if i do 4 and 2 it show 42 so it goes from big to small... but i don't think that's a problem so thanks anyway Jorndel
    So, solved now?
    Or you still not managing the GroupBoxes ?

    EDIT:
    And the Fix think I did.
    I don't think it will work as meant to do...
    Haven't tested so :S

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  12. #27
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed
    Quote Originally Posted by Jorndel View Post


    So, solved now?
    Or you still not managing the GroupBoxes ?

    EDIT:
    And the Fix think I did.
    I don't think it will work as meant to do...
    Haven't tested so :S
    well, i'll see but i think it's solved, only question now is: can i draw just a black line on a form? So instead of groupboxes i'll just use lines to seperate the 18 players...

  13. #28
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,540
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    well, i'll see but i think it's solved, only question now is: can i draw just a black line on a form? So instead of groupboxes i'll just use lines to seperate the 18 players...
    Yes, just remember to include the VB dll if you use the VB stuff

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  14. #29
    stevonator's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    141
    My Mood
    Stressed
    Quote Originally Posted by Jorndel View Post


    Yes, just remember to include the VB dll if you use the VB stuff
    confused, what vb stuff and what dll?

    And how can i draw such a line?

  15. #30
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,540
    My Mood
    Angelic
    Quote Originally Posted by stevonator View Post
    confused, what vb stuff and what dll?

    And how can i draw such a line?


     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Checkboxes
    By Offbeat Ninja in forum C++/C Programming
    Replies: 0
    Last Post: 07-02-2008, 06:19 PM
  2. How to make checkboxes for vb6 for Warrock
    By Desymondo in forum Visual Basic Programming
    Replies: 1
    Last Post: 10-21-2007, 06:49 PM
  3. how to make checkboxes for vb6 for warrock
    By Desymondo in forum WarRock - International Hacks
    Replies: 3
    Last Post: 10-21-2007, 11:52 AM
  4. 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
  5. [Tutorial] VB Checkboxes/Superjump/Pointers/Password Protection
    By mains3rv3r in forum WarRock - International Hacks
    Replies: 26
    Last Post: 06-29-2007, 02:17 AM