Setting a Property by Default in designer to container form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a component that needs to have access to the form on which it is placed. The component has a MyForm property that is to contain a pointer to the form in which it is contained. I can set this manually using the properties of the component but I wondered if it was possible to set it to the Form automatically when the component is dropped on the form

The MainMenu component seems to achieve this but I cannot work out how. I am assuming use of attributes but I cannot find one that seems to be appropriate, any suggestions would be greatfully received.
 
Trevor said:
I have a component that needs to have access to the form on which it is
placed. The component has a MyForm property that is to contain a pointer to
the form in which it is contained. I can set this manually using the
properties of the component but I wondered if it was possible to set it to
the Form automatically when the component is dropped on the form.
The MainMenu component seems to achieve this but I cannot work out how. I
am assuming use of attributes but I cannot find one that seems to be
appropriate, any suggestions would be greatfully received.

The Control has a Parent Property and Component has a Container Property.
Actually these properties are set automatically when you drop that on the
form ( Actually they are set at the creation time ). I don't know why you
need a MyForm property for that.
 
Back
Top