Hi Bonnie,
Just tried it and it works. Thanks!
Looks as if it doesn't fire until after the containing form's InitalizeComponent() has completed which is exactly what a need but a bit counter-intuitive given that all of it's properties have been set and it's been added to the form before the event fires :-{
Thanks again,
Viv
>
>Have you tried the OnCreateControl event?
>
>~~Bonnie
>
>
>
>>Hi,
>>
>>I have a class derived from the Panel control that is used on several forms. Currently this class creates its own Toolstrip in its constructor.
>>
>>Now there is a requirement for the toolstrip content to vary (slightly) depending on which form it is sited on so I've added a couple of public properties to the panel to control the toolstrip creation (intending to set these at design time in each form)
>>
>>Obviously the toolstrip creation can now longer be handled by the constructor but I can find no other obvious panel event to use. I thought ParentChanged() might work but this fires when the control is added to the form and the auto-generated code does this before initializing the properties.
>>
>>Any suggestions on how to do this (I really don't want to have to explicitly call a panel function from the containing form)
>>
>>TIA,
>>Viv
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only