Persisting properties of child controls contained in USER CONTOLS
-
Is there a simple straight forward method of persisting properties of child controls which are contained within user controls? I have a user control which inherits from panel, on that panel is a single text box. The panel user control exposes the text box through a HostedControl property so that the user can set the MultiLine property at designtime. However, that property change is not serialized. It seems that I either have to expose a multiline property on the user control which drives the text box property, or I have to somehow serialize the properties of the text box myself. Any pointers would be appreciated (ooh, provided there to valid memory locations ;-) ). Just to make this abolutely clear. When I add the text box to the Panel user control, if I set the multiline property then all is well, but when I compile my panel/text hybrid control and place it on a form, then all the properties from the panel user control are serialised, but the properties of the text box are not. I view this as pretty obvious behaviour which seems to make sense, but how do I work around it? Nursey
-
Is there a simple straight forward method of persisting properties of child controls which are contained within user controls? I have a user control which inherits from panel, on that panel is a single text box. The panel user control exposes the text box through a HostedControl property so that the user can set the MultiLine property at designtime. However, that property change is not serialized. It seems that I either have to expose a multiline property on the user control which drives the text box property, or I have to somehow serialize the properties of the text box myself. Any pointers would be appreciated (ooh, provided there to valid memory locations ;-) ). Just to make this abolutely clear. When I add the text box to the Panel user control, if I set the multiline property then all is well, but when I compile my panel/text hybrid control and place it on a form, then all the properties from the panel user control are serialised, but the properties of the text box are not. I view this as pretty obvious behaviour which seems to make sense, but how do I work around it? Nursey
at design time on the panel control, set Modifiers property of the textbox to Public or Friend. no need to use anaa property 2 xpose the same. then u'll b able to manipulate the text box anywhere. :rose::rose:
-
at design time on the panel control, set Modifiers property of the textbox to Public or Friend. no need to use anaa property 2 xpose the same. then u'll b able to manipulate the text box anywhere. :rose::rose:
Kamush, Thanks, but that's not the answer. First, I have already exposed the text box as you say by making it public. But two things, firstly when the programmer changes the properties at DESIGN TIME, the windows designer doesn't seem to generate code to effect those property changes at run time. I don't know why. Second, I asked, can my PANEL control expose all the events of the TextBox. My feeling is it can't, without inheriting TextBox, which I can't do because I want a panel that CONTAINS a text box. As I said, this kind of makes sense but its frustrating. or....I still don't understand something, and your answer is right, and my understanding of it is wrong 8-) Thanks. Nursey