By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,724 Members | 859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,724 IT Pros & Developers. It's quick & easy.

Creating an inherited control

P: n/a
Hi all - we've recently switched up to 2005, and I'm having trouble
getting the hang of some things, among them, creating a control for the
project. Currently, we use a combination of controls on a TabControl -
mainly a grid on one tab, and a checkboxlist on the other, that
coordinate back and forth, so (un)checking a box will hide or show a
column on the grid. In addition, I would like the flexibility of adding
a DataSource at design time to the grid, and being able to edit the
columns displayed and maintained by the grid.

Initially, I simply copied the current setup to a control, which worked
well enough for appearance. However, I couldn't figure out how to
properly expose properties such as the Columns so that editing them
from my form would cause the changes to persist. They always
disappeared after rebuilding.

That led me to attempt to make a control that would provide the
majority of this, and simply allow a user to drop a grid onto a blank
tabpage. However, this is where I'm getting stuck, as I'm not sure how
to make a user control that will allow me to place another control on
it. I thought that creating an inherited control from TabControl would
allow me to do this, but I am unable to do so, as when I go to create
an Inherited Control in development, I am not allowed to use anything
other than UserControl (and the other controls I've made in this
project) as a base control.

Thanks in advance for any help you can offer.

- b

Apr 20 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

If you want to create an inherited tab control I would add a new
class to the project and have it inherit tabcontrol.

Ken
---------------

"ben m" wrote:
Hi all - we've recently switched up to 2005, and I'm having trouble
getting the hang of some things, among them, creating a control for the
project. Currently, we use a combination of controls on a TabControl -
mainly a grid on one tab, and a checkboxlist on the other, that
coordinate back and forth, so (un)checking a box will hide or show a
column on the grid. In addition, I would like the flexibility of adding
a DataSource at design time to the grid, and being able to edit the
columns displayed and maintained by the grid.

Initially, I simply copied the current setup to a control, which worked
well enough for appearance. However, I couldn't figure out how to
properly expose properties such as the Columns so that editing them
from my form would cause the changes to persist. They always
disappeared after rebuilding.

That led me to attempt to make a control that would provide the
majority of this, and simply allow a user to drop a grid onto a blank
tabpage. However, this is where I'm getting stuck, as I'm not sure how
to make a user control that will allow me to place another control on
it. I thought that creating an inherited control from TabControl would
allow me to do this, but I am unable to do so, as when I go to create
an Inherited Control in development, I am not allowed to use anything
other than UserControl (and the other controls I've made in this
project) as a base control.

Thanks in advance for any help you can offer.

- b

Apr 20 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.