Results 1 to 5 of 5

Thread: [RESOLVED] adding CheckBox at runtime

  1. #1

    Thread Starter
    Frenzied Member avrail's Avatar
    Join Date
    Mar 2006
    Location
    Egypt, Cairo
    Posts
    1,221

    Resolved [RESOLVED] adding CheckBox at runtime

    how can i add an array of a 3 CheckBoxs at the run time in the pocket pc?
    i try this:
    Code:
    CheckBox[] addCheckBox = new CheckBox[3];
    Form1 frm = new Form1();
    for( int i = 0; i< 3 ; i++) 
                {
                    addCheckBox[i] = new CheckBox();
                    addCheckBox[i].Text = "hi vbforums";
                    frm.Controls.Add(addCheckBox[i]);
                    addCheckBox[i] = new CheckBox();
                }
    but this wasnt good
    any one have any ideas
    thanks alot
    You Don't Have to Rate Me.
    I'm Not a Civilized Man I'm the Civilization it self
    White or Black, Living or Dieing and 0 or 1 that's MY life
    iam an Object in Object Oriented Life
    my blog : http://refateid.blogspot.com/
    twitter :@avrail
    010011000111010101110110001000000100110101111001001000000101000001100011

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: adding CheckBox at runtime

    Search the .NET section on adding controls at runtime. I believe the technique is the same for the CF as for the full .NET, and I know there are LOTS of theads on that over in .NET.
    My usual boring signature: Nothing

  3. #3
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: adding CheckBox at runtime

    Hi,
    You are nearly there. You need to position it, size it, and make it visible for it to appear

    Pete
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: adding CheckBox at runtime

    You may also want to add handlers, though, which is what those other threads would walk you through.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Frenzied Member avrail's Avatar
    Join Date
    Mar 2006
    Location
    Egypt, Cairo
    Posts
    1,221

    Re: adding CheckBox at runtime

    well, it workes fine now
    i can added all my check boxes,
    but about the checkbox.text can i make this text multi-line text
    thanks alot
    You Don't Have to Rate Me.
    I'm Not a Civilized Man I'm the Civilization it self
    White or Black, Living or Dieing and 0 or 1 that's MY life
    iam an Object in Object Oriented Life
    my blog : http://refateid.blogspot.com/
    twitter :@avrail
    010011000111010101110110001000000100110101111001001000000101000001100011

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width