Adding Controls to User Control
Hello,
I'm trying to add custom controls to a user control, and render them to it. I have a viewer user control in which several of these controls are built:
//Create a verse item and assign the values to the property
VerseItem verseControl = new VerseItem();
verseControl.Visible = true;
verseControl.Enabled = true;
verseControl.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
verseControl.Number = verse.Number;
verseControl.Text = verse.Text;
//Add the control to the collection
this.Controls.Add(verseControl);
Then after the for loop, I invalidate the user control, but nothing is showing? I'm sure I'm doing something wrong; how do I add controls to this control? Do I have to add it to a panel in the user control instead?
Thanks.
Brian
__________________
Brian
|