I have discovered the solution to my question. If you want to edit
properties for any nested control within a UserControl and not have your
program forget any changes made in the Property Designer window once the
program is executed, you should leave the scope of the control as Friend
(i.e. don't make it Public) and, instead, create a property for it like so:
e.g. Exposing a button called 'Button1' on a UserControl
Imports System.ComponentModel
<DesignerSerializationVisibility(DesignerSerializa tionVisibility.Content)> _
Public ReadOnly Property MyButton() As Button
Get
Return Me.Button1
End Get
End Property
- Don
"Don" <un*****@oblivion.com> wrote in message
news:1p1pe.1587829$8l.1445249@pd7tw1no...
I've created a custom UserControlwithin which I have placed a Panel. I've
changed the Panel's "Modifier" property to Public so that it appears in
the Properties Window of the UserControl. This way, I could modify the
properties of the panel within the UserControl when I place a UserControl
on a Form. Or so I thought.
I can set the properties of the Panel within the UserControl via the
Properties Window, but none of the changes made to the Panel inside the
UserControl in this way are remembered when I actually run the project.
Has anyone come across this before? Is there a fix for this?
- Don