I don't want to make each of the private controls public. Also, I think I
tried this and it didn't work. I found some posted code on another site, but
it's for VB, and haven't got it to work for C# yet:
Public Property Get Controls() as Object
Set Controls = UserControl.Controls
End Property
I tried to port it to C#, but don't think I've got the syntax correct:
public Object controls
{
set
{
controls = this.customPanel1.Controls;
}
get
{
return(controls);
}
}
Thanks for your assistance! -Jokra
> One way would be to change the access modifier for the controls to public (I
> believe the detault is Friend (Internal) in VB and Private in C#). However,
[quoted text clipped - 28 lines]
> >
> > Thanks.
Imran Koradia - 12 Oct 2004 18:17 GMT
> I don't want to make each of the private controls public. Also, I think I
> tried this and it didn't work. I found some posted code on another site, but
[quoted text clipped - 16 lines]
> }
> }
I assume you only want to be able to get the controls collection rather than
set it, right? In that case, here's the syntax:
public Object Controls
{
get
{
return(this.customPanel1.Controls);
}
}
hope that helps..
Imran.
Jokra - 12 Oct 2004 19:27 GMT
Imran-
Thank you so much. I ended up doing exactly what you first suggested,
setting the constituent controls modifier property to Public, then set the
usercontrol modifier property to Public within the main form.
Thanks for your help!
-Jokra
> > I don't want to make each of the private controls public. Also, I think I
> > tried this and it didn't work. I found some posted code on another site,
[quoted text clipped - 31 lines]
> hope that helps..
> Imran.