开发者

Rich Text Editing in Windows Forms

I am using this text editor for my windows forms application

This works grea开发者_如何学Pythont and is a wonderful control, however I am trying to accomplish one task: I wanted to insert a custom tag to the underlying html for eg if user clicks on a button on form I want to insert a tag <myTag>value</myTag>" at the cursor's position of text editor.

Can anyone guide me how to achieve this?


Guys, Thanks for responses, following code solves the issue

        IHTMLTxtRange range = doc.selection.createRange() as IHTMLTxtRange;
        range.pasteHTML(string.Format("<span>myTag</span>",range.text));
        range.collapse(false);
        range.select();


get column and rows of cursor and put your HTML tag there. example if my cursor is blinking some where on the page try to get its X and Y (Rows and Columns).


I am facing the issue: Code Generation for the Property 'Body Background Color' failed. Error was: 'Property Accessor 'BodyBackgroundColor' on object editor 1 threw the following exception 'Input string was not in correct format'.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜