How do you create Multi-Carets in a TextBox C# - c#

I find many professional text editors like Sublime Text and Synwrite that has a feature as a Multi-Caret editor. The text caret will actually insert to different lines inside the editor so you can actually edit multiple lines for the same type of code. So there's no need for copy paste anymore.
So can anyone help to achieve this in C#?

Related

C# Copying and pasting code with related formatting details

Looking for away to copy and paste my code form Visual studio to a word document with code formatting e.g. different colours for key words etc.
Is there also a way to directly output your selected code into a pdf file?
You can do that using pspad program. Export it to the .rtf then open in MS Word and save as .pdf.
It will stay colored.
UPDATE
But when I tried it now, it will stay colored, but. public void for example is black bold (I would say) instead of blue. I think you can work around that.
Managed to find a solution to my own problem.
1)Use notepad++, copy and paste code from VS, select the coding language you are using from "Language"
2)then highlight all the code you want to copy with formatting in notepad++
3)Plugins -> Nppexport -> copy RTF to clipboard
then paste code where ever you want, should paste with formatting

How to automatically color text depending by programming language in C# richtextbox?

Maybe my question already have posted previously but I didn't find.
I have WinForm (C#) and I put a richtextbox.
I want to paste a SQL code and I want that reserved keywords from pasted text to be colored in blue or other specific color for reserved keyword.
How to achieve this in C# code if is possible ?
You're looking for something called syntax highlighting. There are multiple libraries available to do this, but i would recommend taking a look at http://colorcode.codeplex.com/

Edit Word template in C#

I'm stuck in a project for school.
I have a word template, this is a empty document but it has some formatting, for example, each page has 25 lines, the font is Times New Roman and its size 12.
What I have to do is to open this template, write information and save it. When I open the template I should see the text displayed respecting the format.
How can I do this? I tried DocX library but I couldn't make work Line Spacing feature.
You can user whatever you want to make it work. It must be in C#.
Does it need to be C#? Maybe they want you to use vba?

Generate HTML from a plain text

I have a desktop application displaying text in a read only RichTextbox component. Some words in the text needs to be highlighted depending on a text analyze that was previously executed.
Now I need to create a web version of this application.
I know there's a couple of Rich Text Editors available but I would like to know if there's a library or a simple way to generate an properly tagged HTML string from a plain text and a list of word to highlight?
Here you have a free extension to RichTextbox that do what you want:
http://www.codeproject.com/Articles/12172/An-extended-RichTextBox-to-save-and-load-quot-HTML
You can use TinyMCE. This is free javascript based Reach Text Editor for the web.
TinyMCE Reach Text Editor

Mimic Excel Text Import wizard in Winforms

I have a requirement to paste the clipboard data to a textbox and split the data into columns as what we can do in Excel Text Import wizard.
Can anybody suggest me a starting point to get hold of this?
an idea can be put each character of first line of the text in many TextBox control which created and arranged horizontally in a windows form so an user can separate line by clicking on each text box to show the breaking points
I've found some old CPP code for a control here:
http://www.codeproject.com/KB/miscctrl/separator_ctrl.aspx
I'm still trying to find an updated version for .NET. (I'm not sure I have the time to try to convert this, myself.)

Categories

Resources