Event when Cursor goes to Header/Footer

    • Offizieller Beitrag
    Zitat

    I need to be able to control the enabled status of some menu items in our app subject to if the user has selected the head, body or footer sections. How is this best implemented with the TWPRichText component ?

    You can use the event OnWorkOnTextChanged.

    Example - disable the insert foonote menu item:

    Code
    procedure TWPTBXForm.WPRichText1WorkOnTextChanged(Sender: TObject);
    begin
        if WPRichText1.WorkOnText<>wpIsBody then
             InsertFootnoteBtn.Enabled := FALSE
        else InsertFootnoteBtn.Enabled := TRUE;
    end;