Search code examples
vb.netwinformspropertiescontrolsforwarding

Forward all properties of a control


I'm making a custom control (that's what I do, I'm a theme designer) and I'm having trouble with something. The control I'm making is a custom RichTextBox control. Since I want a custom border (rounded edges) arround the RichTextBox, I simply have a control with custom borders, and a child control which is actually a normal RichTextBox. With the BorderStyle set to none, it looks like this:

My rich textbox control

Now, of course, the parentcontrol needs to have all the properties a normal RichTextbox has. I manually did all the properties for a regular textbox, but a RichTextBox has far more properties and I was asking myself, is there any way to "forward" all properties of the child control to the main control?

Maybe I'm explaining it a bit oddly. Basically, when you change the main control's "Text" property the RichTextBox's Text property should change too. This means I have to write a custom event for every Property a RichTextBox has, isn't there a way to do this for every property automatically?

Thanks in advance,

Mavamaarten.


Solution

  • Turns out there is no way to do this.