Nettet17. okt. 2016 · Sorted by: 4. You can use RichTextBox.GetLineFromCharIndex (). Pass in the SelectionStart property value from the text box. Share. Improve this answer. Follow. answered Jan 26, 2011 at 6:10. Olhovsky. Nettet14. des. 2014 · The minimal code that does what you want is: rtb.Select (0, rtb.GetFirstCharIndexFromLine (1)); // select the first line. rtb.SelectedText = ""; You may want to get the current selection, using rtb.SelectionStart and rtb.SelectionLength, so that you can restore it after deleting the line (just remember to shift the selection start to …
WPF RichTextBox to create editor with line numbers
Nettet2024-06-01 17:23:58 1 110 c# / winforms / richtextbox 使用WPF,我可以在用戶在richtextbox中鍵入內容時自動進行單詞替換嗎 [英]using WPF can I do auto word replacement when a user is typing in richtextbox Nettet20. jun. 2024 · I have a large text files for example 39000 lines and above , i want to load it into richtextbox , using normal way like this: Richtextbox1.Text=File.ReadAllLines (file); or. Richtextbox1.LoadFile (...); it take long time and freeze the UI even i use BackgroundWorker, so i decide to split file into parts each part is 1000 lines and … blowsiness
RichTextBox Overview - WPF .NET Framework Microsoft Learn
NettetThe line numbering can be turned on or off. It's fast. It scrolls cleanly. You can select the color of the numbers, the background colors for a gradient, the border thickness, the font, whether to use leading zeros. You can choose to number lines "as displayed" or according to the hard newlines in the RTB. Examples: It has limitations: it ... NettetC# : How to show number of a line in a RichTextBox C#To Access My Live Chat Page, On Google, Search for "hows tech developer connect"So here is a secret hidd... NettetTo read lines of a WPF RichTextBox you can use the following code. TextRange textRange = new TextRange (rtb.Document.ContentStart, rtb.Document.ContentEnd); string [] rtbLines = textRange.Text.Split (Environment.NewLine); foreach (line in rtbLines) { //do something with line } for this specific code, you will need to use the following library. free fire apk actualizado