How can I add an Items-like property to my User Control?
- by Dan Tao
It's pretty straightforward to add simple properties to a User Control that will appear in the desired categories in the Windows Forms designer, e.g.:
[Category("Appearance")]
public Color BackColor {
get { return _textBox.BackColor; }
set { _textBox.BackColor = value; }
}
What if I want to expose a more complex property, such as a collection of items of a type I define? I'm thinking something along the lines of the ListView.Items property, or the DataGridView.Columns property -- where the user of the control can access this complex property via a more specialized pop-up form (as opposed to a simple TextBox or ComboBox).
Even a simple nudge in the right direction would be much appreciated.