Derived ListBox Control

D

David Veeneman

I am deriving a custom control from a list box, in order to add the ability
to edit a list item's text. The easiest way to do it is to simply place a
text box at the appropriate position on the list box, edit in the text box,
then get the value from the text box when it loses focus or the user hits
Enter.

Here's my problem: Adding a text box to a UserControl is easy enough. But
can I add one to a control that is derived from the ListBox control, insteal
of the UserControl base class? Any ideas on how to get this done? Thanks
 
P

Peter Duniho

David said:
[...]
Here's my problem: Adding a text box to a UserControl is easy enough. But
can I add one to a control that is derived from the ListBox control, insteal
of the UserControl base class? Any ideas on how to get this done? Thanks

The Controls property for all control classes is inherited from the base
Control class. All controls can have child controls; you just add the
child control to the Controls collection.

Pete
 
D

David Veeneman

Thanks--I'll give that a try.

Peter Duniho said:
David said:
[...]
Here's my problem: Adding a text box to a UserControl is easy enough. But
can I add one to a control that is derived from the ListBox control,
insteal of the UserControl base class? Any ideas on how to get this done?
Thanks

The Controls property for all control classes is inherited from the base
Control class. All controls can have child controls; you just add the
child control to the Controls collection.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top