Giving a component property a default value of its containing form

G

Guest

I am trying to design a component that is dropped into a form and adds functionality to the window. To do this it must get a pointer to the form in which it is held as it cannot inherit this from a parent class. Thats easy to do but it would be good if this all got setup without any input from the person using the component. Currently you have to choose the form from a list.....

I thought initially that Attributes could be used but I cannot seem to make that happen. If anybody can suggest how to make this work I would be greatful.
 
A

Andrew S \(Infragistics\)

You would have to create a custom designer for the component and then in
something like the onsetcomponentsdefault, get the idesigerhost service and
get its rootcomponent. Then set the property of the component that the
designer is managing to that value.

Trevor said:
I am trying to design a component that is dropped into a form and adds
functionality to the window. To do this it must get a pointer to the form
in which it is held as it cannot inherit this from a parent class. Thats
easy to do but it would be good if this all got setup without any input from
the person using the component. Currently you have to choose the form from
a list......
I thought initially that Attributes could be used but I cannot seem to
make that happen. If anybody can suggest how to make this work I would be
greatful.
 

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