[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
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.
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
Re: adding CheckBox at runtime
You may also want to add handlers, though, which is what those other threads would walk you through.
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