Container controls

I have a container control with a textfield within it, I am trying to pass the lost focus event up to the container control by using call raise event in the test fields lost focus property.
However it does not seem to raise the event when I drop the control on a page. Is this the correct procedure?

Dave

Have you set “AllowFocus” of the ContainerControl to True in the Property Inspector?

1 Like
Window1

  Controls:

    TextField1   // another textfield to be able to focus to

    CC           // instance of ContainerControl1 (see below)
                 // AllowFocus needs to be set to True

      Events:
        Sub LostFocus()
          System.DebugLog "CC.LostFocus"
        End


ContainerControl1

  Event Definitions:
    Event LostFocus()   // so CC in Window1 can implement this event

  Events:
    Sub LostFocus()
      RaiseEvent LostFocus()     // react to CC losing focus
    End

  Methods:
    Sub RaiseEvent_LostFocus()
      RaiseEvent LostFocus()     // react to TextField1 losing focus
    End

  Controls:

    TextField1:

      Events:
        Sub LostFocus()
          ContainerControl1(Self).RaiseEvent_LostFocus()

I did not know that will try today ! Thanks