[Click Here](http://www.imageupload.co.uk/images/2015/03/15/rtb.png) what i want is that when i write any thing on the richtextbox it appear on cell Text. I have found some codes on the internet but i don't know whats wrong: for (int i = 0; i < richTextBox1.Lines.Length; i++) { ListViewItem lvi = new ListViewItem(i.ToString()); lvi.SubItems.Add(richTextBox1.Lines[i]); listView1.Items.Add(lvi); } ///PS -- Its for two columns The other thing, I post Numberupdown item and i want to appear the time on it and on the cell time like this ""HH:MM:SS / 00:00:00"" so i control it by arrow So, any ideas guys ? P.S. I know that i …

Member Avatar
Member Avatar
+0 forum 4

hi, 1st of all thank you guys again for all of your help. ![a3ce81a2808d02214775965e56a6d32b](/attachments/large/4/a3ce81a2808d02214775965e56a6d32b.png "a3ce81a2808d02214775965e56a6d32b") i have this datagrid view and i want to write it on a richtextbox like: 14 APPLE0-13 @ 60.00 840.00 so on and so forth. how can i achieved getting all of them and can i also ask how do you space them?what is padding?do i use padding?how to use padding? I really appriciate it guys i can only say thank you for the help you are giving me. btw does foreach come in play with my question? thank you, arigato, salamat, gracias

Member Avatar
Member Avatar
+0 forum 8

I have a rich text box in my winform. I want to format the text so that i can write a simple C code in it. I mean the indentation should be done accordingly (like the code tag on websites). Is it possible??

Member Avatar
Member Avatar
+0 forum 1

I want rich textbox control in java in nebeans, where i can able to paste content from documents. Here content means not only plain data but also tables from ms-word documents. I tried above feature using "jeditorpane" but i am unable to retain table structure. please suggest me how to do it? Thanks.

Member Avatar
Member Avatar
+0 forum 1

I am using the richtextbox, and now when I am saving the File, then the File get saved but not as I want.? Example: File Name: example File extension: .txt Body: **1.)**Hey guys, Whats up? **2.)**R u Fine ??? **3.)**Reply soon Now When I save the file and open in the notepad. then its seem as: **1.)**Hey guys, Whats up?R u Fine ???Reply soon while if I open the same file with Wordpad then no problem it looks as it should... So how can I edit this things. Using Richtextbox only, reason: change specific text fonts/colour/save as rtf,txt,doc etc... If …

Member Avatar
Member Avatar
+0 forum 2

Hi Everyone, I would like to know if there is any way to change the color of a part of text in rich textbox when the user types it automatically like the way in vb.net IDE (Classes have blue etc.). Thanks in advance, Yuvjeeth

Member Avatar
Member Avatar
+0 forum 3

Hi, I am making a richtextbox to html convertor, I have added features like bold italic underline left align right align center align etc. I found a code to convert richtextbox to html but i am not sure how to use that function. Public Shared Function FromRtf(ByVal rtf As RichTextBox) As String Dim b, i, u As Boolean b = False : i = False : u = False Dim fontfamily As String = "Arial" Dim fontsize As Integer = 12 Dim htmlstr As String = String.Format("<html>{0}<body>{0}<div style=""text-align: left;""><span style=""font-family: Arial; font-size: 12pt;"">", vbCrLf) Dim x As Integer = 0 …

Member Avatar
Member Avatar
+0 forum 6

I'm having trouble with a bit of code here. What I'm trying to do is paste multiple images(generated from a helper function) into a RichTextBox. Here's my code: string tempText = "For the arithmetic progression $a_1, a_2, a_3, ... a_9$ it's known that $a_2 + a_8 = 8$. The sum $a_1 + a_2 + a_4 + a_5 + a_6 + a_8 + a_9$ is equal to:\nA) 14;\tB) 16;\tC) 36;\tD) 32."; for (int i = 0, lastOcc = 0, numDoll = 0; i < tempText.Length; i++) { if (tempText[i] == '$') { numDoll++; if (numDoll % 2 == 1) { problemText.Text …

Member Avatar
+0 forum 0

I am doing a syntax highlighter (which is my first c# project) and I have some performance problems. Every time I have to color a word, I stop the repaint, color the word, enable repaint and invalidate the richtextbox. This is the richtextbox class: namespace test { class rtb:RichTextBox { [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); private const int WM_SETREDRAW = 0x0b; public void BeginUpdate() { SendMessage(this.Handle, WM_SETREDRAW, (IntPtr)0, IntPtr.Zero); } public void EndUpdate() { SendMessage(this.Handle, WM_SETREDRAW, (IntPtr)1, IntPtr.Zero); this.Invalidate(); } } } The invalidation (refresh) causes, sometimes, some rows of text to …

Member Avatar
Member Avatar
+0 forum 2

Hello, I was wondering if there is a way to display formatting in a richtextbox eg. If i put **test** the word "test" would be i bold (only the word "test" and the rest would stay the normal). or if i put `test` the word "test" would be i size 10 (only the word "test" and the rest would stay the normal size). Please help

Member Avatar
Member Avatar
+0 forum 3

I have the following code : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace PentruTestari { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { richTextBox2.Text = "int int"; richTextBox2.SelectionStart = 0; richTextBox2.SelectionLength = 7; richTextBox2.SelectionColor = Color.Red; richTextBox2.SelectionLength = 0; richTextBox2.SelectionStart = 4; richTextBox2.SelectionColor = Color.Black; } private void richTextBox2_Click(object sender, EventArgs e) { MessageBox.Show(richTextBox2.SelectionColor.ToString()); } } } Every time I click right before the second "int" , the SelectionColor is black. But when I click at the middle of …

Member Avatar
Member Avatar
+0 forum 4

I recently started to learn rich text format and i am encountering a bizarre behavior. Here is the code: private void button2_Click_1(object sender, EventArgs e) { s = richTextBox1.Rtf; s = s.Insert(s.IndexOf("colortbl ;") + 10, @"\red0\green255\blue0;\red128\green0\blue0;\red128\green128\blue0;"); LockWindowUpdate(richTextBox1.Handle); string t = @"{\cf3 test }"; s = s.Insert(s.IndexOf("int") + 3, t); //insert it, for example, after the word "int" richTextBox1.Rtf = s; richTextBox1.SelectionStart = richTextBox1.Text.Length; LockWindowUpdate(IntPtr.Zero); } The rtf of the richtextbox before editing is: {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Consolas;}} {\colortbl ;\red0\green255\blue0;} \viewkind4\uc1\pard\cf1\lang1033\f0\fs20 This line is an int\line This line is an int \line This line is an int \par } Every time I insert …

Member Avatar
Member Avatar
+0 forum 1

Hi, In my program, i have created 10 richtextbox dynamically. in all richtextbox i gather text form various websites. All is going fine. now what i want is- i need to print all/selected richtextbox text to printer and also saves it to Word file as following formate: * Richtextbox1 (or something like header) *richtextbox1.text............. ............................... ............................... ............................... =========================================* * Richtextbox2 (or something like header) *richtextbox2.text............. ............................... ............................... ............................... =========================================* * Richtextbox3 (or something like header) *richtextbox3.text............. ............................... ............................... ............................... =========================================* Can anyone help me on this issue? I hope i can do a crystal report based on it. But I …

Member Avatar
Member Avatar
+0 forum 6

Hello Community, I was wondering if its possible to make an editor like [Notepad++](http://notepad-plus-plus.org) (I'm talking about the text area). So it will change the colour of the words (funtions and commands) also with the margin with the numbers and the code folding. Please help with what you can even if you can give me bits and peices to make the script myself. Thanks

Member Avatar
Member Avatar
+0 forum 2

I have two RichTextBoxes in my vb.net application (rtf1 & rtf2). rtf1 is loaded with the external data. Mostly It contains para split into different sections. The paragraph is a dynamic data, hence the no. of words keep on changing. Now my question is that, I want to select a para from the cluster, copy it and paste it into rtf2. Manually I did as, Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Rtf1.Copy() Rtf2.Paste() Clipboard.Clear() End Sub Then I added brackets to the para contents as: [para content goes here is a multiline] Rtf1.Select(Index, Length) …

Member Avatar
Member Avatar
+0 forum 7

How to Retrive/select or Get underlined/Formated Text on Click event from rich text box in vb.net... it should be just like Hyperlink but programmed with click event on it, not for Web page but for local cause. i have the coding but its only for single word, i need for multiple Formated/underlined words or Phrase Please, ' Getting the word under the mouse clicked loaction 'If e.Button = MouseButtons.Left Then ' Dim CharIndex As Int32 ' Dim StartPos As Int32 ' Dim EndPos As Int32 ' 'location of mouse clicked ' CharIndex = txtInfo.GetCharIndexFromPosition(New Point(e.X, e.Y)) ' 'Locating the end …

Member Avatar
+0 forum 0

Hi everyone, I am new to RichTextBox control in VB6 I wanted to select the entire line/row in the RichTextBox, where currently the cursor is. How should I do it ? The code should be paste in command button 'cmdSelect' Thanks in advance :)

Member Avatar
Member Avatar
+0 forum 5

Hi, I'm having a problem with taking the user input from a richtextbox in Unicode and writing it to a Unicode text file. I'm able to read a different Unicode file and write it to the new file, but when it comes to writing the contents of the richtextbox to the new file, nothing appears. I've tried debugging it, and I can see that the wstring is assigned correctly, I just can't see why this won't write to file. What am I doing wrong? [CODE] private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { std::wifstream inFile(L"testin.txt", std::ios::in | std::ios::binary); std::wofstream outFile(L"test.txt", std::ios::app …

Member Avatar
Member Avatar
+0 forum 2

Hello all, I'm taking my first BASIC programming class this year, and for a final project, I'm trying to make a book-keeping log. What I want to have happen, is to open a list of books, highlight a book title, click the "check in" button and have the text change to green, or red if the "check out" button is clicked, but I'm having problems trying to change the color of the text. If anyone could explain how to do so, it would be greatly appreciated. Thanks in advance!

Member Avatar
Member Avatar
+0 forum 1

hi guys:)if i have three lines saying "line1","line2"and "line3" and if i want to modify the first line to "line1 ok", the second to "line2 ok " and replace in there original location so i will have "line1 ok",line2 ok" ,"line3" for each line after modification.what should i do to do this.thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

hi i want to write a text in any line inside a rich text box how can i do that ?am now able to append to existing one or insert to the beginning of the rich text box but i want to write to any line inside the text box.

Member Avatar
Member Avatar
+0 forum 1

Good Day everybody, I am wanting to make a program in VB.NET that has many files.doc in a specific folder. This program has on top a textbox(txtSearch) with a button(btnSearch) under that this has two listbox(lstOption, lstResult), that are floating a left, one richtextbox(rtbDoc) that is floating a right. I want that when the user writes in txtSearch and click on button then the application will read all files, and find for this string. When it complete: the first listbox's item are: All words matches, Some words matches initial letter of words matches Then when the user click on one …

Member Avatar
Member Avatar
+0 forum 14

i have a richtextbox where the user inputs his/her name.. This needs to always be 60pixels wide, regardless of text.. ie: Johnathon or Tim need to be resized to best fit the control. i've looked on the net, but only found VB solutions. Is there a way to achieve this?.. Thanks..

Member Avatar
Member Avatar
-1 forum 3

i have created a code for log. it is intended to provide the user with a recent history of various events, primarily used in data-gathering applications where one might be curious how a particular transaction completed. In this case, the log need not be permanent nor saved to a file. \*i have to show the status of a running process in the same line of listbox.\* for this i used the below code inside the for loop.the problem is that each time it enters for loop list box get updated and there is flickering in listbox.i need to avoid this …

Member Avatar
Member Avatar
+0 forum 3

hi, i have a panel with controls and richtextbox's within it. When the user clicks the save button, i take panel1 and DrawToBitmap, then add the image to a pdf created using abcPDF7. My problem is that i have recently change textbox's with richTextBox's to enable the user more functionality, but they are not being rendered into the image. If i add a normal textbox it works fine, with the exact code, but not with richtextbox. am i missing something? why would it not render? Thanks. [CODE] Doc myDoc = new Doc(); myDoc.TopDown = true; String myTempPath = Path.GetTempPath(); const …

Member Avatar
Member Avatar
+0 forum 1

Hello I am currently stuck on trying to collect some string items from a richtextbox and then count how many items there are. I then want to relocate one of the string items if there are more than three into another richtextbox. I currently have been attempting to capture the string items into an array but I have had no luck. The items in the richtextbox are Laura Philips Jaime Jarvis Rachel Dawkins So in this case I would want to remove the last entry "Rachel Dawkins" and place it into another richtextbox. If anyone could give me an example …

Member Avatar
Member Avatar
+0 forum 5

Hi all... I am developing one program but i just came to one obsticle that I really dont know how to pass it. on my form i will have some options that user needs to enter after that im puting it and drawing it in printpreview eventhandler. So user can see what is going to be printed as regular format. Problem is starting when i want to send that argument to richtext box and display it to richtext box. i tried stuff like: sending an image...its not working...as far as i know... here is code : [code] public void PrintPageEventHandler(Object …

Member Avatar
Member Avatar
+0 forum 2

I am new in vb.net please help. [CODE]Public Class Form1 Private Sub RichTextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles RichTextBox1.KeyPress RichTextBox1.Text = " Not available " RichTextBox1.Select(RichTextBox1.Text.Length, 0) End Sub End Class[/CODE] I want this code to pass not available like" Not available Not available Not available " Every time the user enter any key " Not available " adds to the string in text box.

Member Avatar
Member Avatar
+0 forum 3

I'm writing a text editor for my own use ( I'm "home learning") where I want to be able to leave comments for myself, like in code section of the VB express IDE. I have figured out how to get the Integer Location of the apostrophy, but can't get it to color the rest of the line. I don't know how to tell the program to find the integer value of the last character in the line. I need that to be able to subtract the apostrophy's location from the last character's location, to get the "SelectedLength". Then I can …

Member Avatar
Member Avatar
+0 forum 6

I'm working on a project in vb.net 2010 that has 3 RichTextBoxes. Two of the RichTextBoxes can be loaded with text from text files. How do I take the multiple lines of text from each RichTextBox and combine them into the 3rd RichTextBox. For example, if 2 of the RichTextBoxes contain the following lines of text: (RichTextBox1) Monday Tuesday Wednesday (RichTextBox2) Jan Feb Mar I want the 3rd RichTextBox to show following result: (RichTextBox3) MondayJan TuesdayFeb WednesdayMar

Member Avatar
Member Avatar
+0 forum 6

The End.