Set default colour of hyperlink and allow user to change

  • Hi,

    I need to be able to allow users to change the colour of hyperlinks in the editor. From my understanding I can do this by disabling the UseTextColor/UseUnderlineColor in the HyperlinkTextAttr property.

    The thing I don't like about this is when the user starts to type the hyperlink it takes the font colour they are currently using which I don't want.

    What I want to do is set a default hyperlink colour so when they first type it, it will always use the default, but they can then change it to suit.

    How would I go about doing this?

    • Offizieller Beitrag

    Hi,

    Hyperlinks are usually created by inserting hyperlink objects into the text.

    I assume you talk about the automatic hyperlinks created during the user input. There is no event for this - you will need to do this in unit WPCtrMemo.pas near

    Zitat

    procedure MakeLinkLastChars(count: Integer);
    begin
    if HyperlinkAtCP = nil then
    begin
    TextCursor.Inserting := TRUE;
    TextCursor.MoveBack(count);