• Creator
    Topic
  • #4440
    ctaleck
    Participant

      What is the proper syntax to call the TWinControl.FindNextControl method?

      I have tried without success:


      Dim Ctrl
      Set Ctrl = MyForm.FindNextControl(MyForm.ActiveControl, True, True, True)

      I have a certain tab order on my form, and I want to follow it to sort a list.

      quote:


      VCL Reference
      TWinControl.FindNextControl
      Returns the control’s next child in the tab order after the specified control.

      function FindNextControl(CurControl: TWinControl; GoForward, CheckTabStop, CheckParent: Boolean): TWinControl;

      Description

      Call FindNextControl to find the next child control in the tab order after CurControl. If CurControl is not a child of the control, FindNextControl returns the first child control in the tab order.

      The GoForward parameter controls the direction of the search. If GoForward is True, FindNextControl searches forward through the child controls in tab order. If Go Forward is False, FindNextControl searches backward through the controls.

      The CheckTabStop and CheckParent parameters control whether FindNextControl performs certain checks on the controls it finds. If CheckTabStop is True, the returned control must have its TabStop property set to True. If CheckParent is True, the returned control’s Parent property must indicate the parent control.

      FindNextControl calls the GetTabOrderList method to build its list of possible “next” controls.


    • Author
      Replies
    • #8182
      ctaleck
      Participant

        Help on this related method is also sought:

        quote:


        VCL Reference
        TWinControl.GetTabOrderList

        Builds a list of controls in tab order.

        procedure GetTabOrderList(List: TList);

        Description

        Call GetTabOrderList to construct a list of child controls in tab order.

        GetTabOrderList iterates through the control’s internal tab-order list, adding each of the child controls to List, including any controls contained in those controls. The result is a list of all the controls and their owned controls, in tab order.

        The FindNextControl method calls GetTabOrderList to build a complete list of the controls that FindNextControl uses to locate the next control in the tab order.


      Viewing 1 replies (of 1 total)
      • You must be logged in to reply to this topic.