Hi all,

For the first time I am creating a control with the Default property and it
doesn´t work at run time. At authoring time I set the DefaultCancel property
to True and the container add the Default and Cancel properties to the
extender object. At design time I can set Default and Cancel properties but
at run time it doesn't work: the control that has TabIndex = 0 becomes the
default control and has the focus. This happens to all of the controls that
have the Default property when one instance of my control is present in the
container.

Example: I put a control (mine) and a Command button on a form and set the
control's Default property to False but if it's TabIndex is = 0, at run time
as the form is loaded the control gets the focus.

I found that the property UserControl.Ambient.DisplayAsDefault is unchanged
till the Show event is fired. The sequence of events is this:
1 - ReadProperties event: (DisplayAsDefault = False)
2 - Resize event (DisplayAsDefault = False)
3 - AmbientChanged event (DisplayAsDefault = *True*)
4 - Show event (DisplayAsDefault = True)

Any ideas to put my control working properly?

Thanks in advance,
Paulo Costa