Set hyperlink to RichTextBox

I created a rtf file with a hyperlink in MS Word and uploaded it to RichTextBox. The hyperlink in RichTextBox does not work. Does RichTextBox and MS Word use different rtf code? How to create a hyperlink with my parameters (use a hyperlink without a URL) in a RichTextBox?

The displayed text is as follows:

Some start the text. There should be a hyperlink: Link_Text. And here is the text after the hyperlink. Some final texts.

Rtf text:

{\ rtf1 \ ANSI \ ansicpg1251 \ deff0 \ deflang1058 \ deflangfe1058 \ deftab708 {\ fonttbl {\ f0 \ fswiss \ fprq2 \ fcharset204 Calibri;} {\ f1 \ fswiss \ fprq2 \ fcharset0 Calibri;}} {colort \ red0 \ green0 \ blue255;} {* \ generator Msftedit 5.41.21.2509;} \ viewkind4 \ uc1 \ pard \ nowidctlpar \ f0 \ FS22 Some start the text. \ Par \ pard be a hyperlink: {\ Field {* \ fldinst {HYPERLINK "Address"}} {\ fldrslt {\ cf1 \ ul Link_Text}}} \ cf0 \ ulnone \ f0 \ fs22. And also here is the text after the hyperlink. \ par Some end text \ lang1033 \ f1. \ lang1058 \ f0 \ par}

+3
source share
1 answer

- , , . , , , rtf. , :

{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fnil\fcharset0 Calibri;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\vieww12000\viewh13860\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural

\f0\fs22 \cf0 Here are some start text, {\field{\*\fldinst{HYPERLINK "http://www.msn.com"}}{\fldrslt this is hyper link}} Here are some final text\
}

, MacVim, rtf, MSWordPad - , TextEdit. , . richtextbox, , -: (.

, .

+2

Source: https://habr.com/ru/post/1793914/


All Articles