P
Paradox
Hey,
I'm trying to figure out what situations call for the use of a derived
form control such as:
public class myListBox : System.Windows.Forms.ListBox
and what situations call for the use of a Custom User Control, generated
by adding a new Custom User Control to a project with VS.NET.
Playing around so far, I found the idea of creating a Customer User
Control and adding a ListBox control to it, kind of ugly. But the
advantage being that I can set it's Custom Tool name and drag and drop
it on to a form with the designer like any of the other controls . The
problem here is that I have to edit the Customer User control to change
the properties of the listbox.
Is there a way to derive a new control from an existing one (as with the
System.Windows.Forms.Listbox example above) and have the drag and drop
functionality with the designer? Is the only way to add a derived
control to a form through the code? And if so, I can't have the code to
add the control inside the designer generated InitializeComponent
function, I have to add it somewhere else right?
I'd really appreciate if someone could help clear up some of my
confusion on this matter. Thanks.
-Paradox a.k.a. Aaron
I'm trying to figure out what situations call for the use of a derived
form control such as:
public class myListBox : System.Windows.Forms.ListBox
and what situations call for the use of a Custom User Control, generated
by adding a new Custom User Control to a project with VS.NET.
Playing around so far, I found the idea of creating a Customer User
Control and adding a ListBox control to it, kind of ugly. But the
advantage being that I can set it's Custom Tool name and drag and drop
it on to a form with the designer like any of the other controls . The
problem here is that I have to edit the Customer User control to change
the properties of the listbox.
Is there a way to derive a new control from an existing one (as with the
System.Windows.Forms.Listbox example above) and have the drag and drop
functionality with the designer? Is the only way to add a derived
control to a form through the code? And if so, I can't have the code to
add the control inside the designer generated InitializeComponent
function, I have to add it somewhere else right?
I'd really appreciate if someone could help clear up some of my
confusion on this matter. Thanks.
-Paradox a.k.a. Aaron