Skip to main content
All docs
V25.1
  • TdxAICommandList.Clear Method

    Clears the AI command collection.

    Declaration

    procedure Clear;

    Remarks

    Call the Clear procedure to remove all AI-powered commands from the collection.

    To remove individual commands, call Delete and Remove methods.

    Code Example: Hide AI-Powered Commands

    The following code example hides all AI-powered commands (removes the AI Assistant item) when no content is selected in the document:

    uses
      dxRichEdit.Control,  // Declares TdxRichEditControl
      dxAI;  // Declares AI-specific types
    // ...
    
    procedure TMyForm.dxRichEditControl1GetAICommands(Sender: TObject;
      const AAICommands: TdxAICommandList);
    begin
      if ((Sender as TdxRichEditControl).Document.Selections.Count = 0) or
         ((Sender as TdxRichEditControl).Document.Selection.Length = 0) then
           AAICommands.Clear;
    end;
    

    VCL Rich Edit: The Context Menu Without AI-Powered Commands

    See Also