Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
Questionslow speed Pin
Xmen Real 29-Jul-07 23:01
professional Xmen Real 29-Jul-07 23:01 
AnswerRe: slow speed Pin
Luc Pattyn29-Jul-07 23:23
sitebuilderLuc Pattyn29-Jul-07 23:23 
GeneralRe: slow speed Pin
Xmen Real 30-Jul-07 2:31
professional Xmen Real 30-Jul-07 2:31 
GeneralRe: slow speed Pin
Luc Pattyn30-Jul-07 2:46
sitebuilderLuc Pattyn30-Jul-07 2:46 
GeneralRe: slow speed [modified] Pin
Xmen Real 30-Jul-07 3:00
professional Xmen Real 30-Jul-07 3:00 
AnswerRe: slow speed Pin
girm29-Jul-07 23:37
girm29-Jul-07 23:37 
GeneralRe: slow speed Pin
Xmen Real 30-Jul-07 2:33
professional Xmen Real 30-Jul-07 2:33 
GeneralRe: slow speed Pin
girm30-Jul-07 21:51
girm30-Jul-07 21:51 
Sure...

* assuming you have a form with 2 rtf , and a button to copy from richTextBox1 to richTextBox2
* assuming you only deal with text

the code below should do the trick in no time

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace rtfTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            richTextBox1.Text = "[ID] = 0000\nlines\n[END]\n[ID] = 1234\nlines for 1234\n[END]";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string beginTag = "[ID] = 1234";
            string endTag = "[END]";
            int startPosition = richTextBox1.Find(beginTag);
            if (startPosition >= 0)
            {
                startPosition = startPosition + beginTag.Length+1;// we start at the first line after beginTag
                int endPosition = richTextBox1.Find(endTag,startPosition,RichTextBoxFinds.MatchCase);
                if (endPosition > startPosition)
                    richTextBox2.Text = richTextBox1.Text.Substring(startPosition , endPosition - startPosition );
            }
                
        }
    }
}

GeneralRe: slow speed Pin
Xmen Real 31-Jul-07 19:08
professional Xmen Real 31-Jul-07 19:08 
QuestionC# Project corrupted? Pin
Vikas K.29-Jul-07 21:21
Vikas K.29-Jul-07 21:21 
AnswerRe: C# Project corrupted? Pin
T.EDY29-Jul-07 21:53
T.EDY29-Jul-07 21:53 
GeneralRe: C# Project corrupted? Pin
Vikas K.29-Jul-07 23:29
Vikas K.29-Jul-07 23:29 
GeneralRe: C# Project corrupted? Pin
Developer61130-Jul-07 0:05
Developer61130-Jul-07 0:05 
GeneralRe: C# Project corrupted? [modified] Pin
Martin#30-Jul-07 0:08
Martin#30-Jul-07 0:08 
GeneralRe: C# Project corrupted? Pin
Vikas K.30-Jul-07 19:54
Vikas K.30-Jul-07 19:54 
GeneralRe: C# Project corrupted? Pin
Martin#30-Jul-07 20:02
Martin#30-Jul-07 20:02 
GeneralRe: C# Project corrupted? Pin
Vikas K.30-Jul-07 20:12
Vikas K.30-Jul-07 20:12 
Questionproblem in generating crysatl reports Pin
monuSaini29-Jul-07 21:14
monuSaini29-Jul-07 21:14 
AnswerRe: problem in generating crysatl reports Pin
Edwin Syarief29-Jul-07 22:18
Edwin Syarief29-Jul-07 22:18 
GeneralRe: problem in generating crysatl reports Pin
monuSaini29-Jul-07 22:58
monuSaini29-Jul-07 22:58 
QuestionRe: problem in generating crysatl reports Pin
T.EDY29-Jul-07 23:28
T.EDY29-Jul-07 23:28 
AnswerRe: problem in generating crysatl reports Pin
monuSaini29-Jul-07 23:33
monuSaini29-Jul-07 23:33 
GeneralRe: problem in generating crysatl reports Pin
T.EDY29-Jul-07 23:42
T.EDY29-Jul-07 23:42 
GeneralRe: problem in generating crysatl reports Pin
Edwin Syarief29-Jul-07 23:47
Edwin Syarief29-Jul-07 23:47 
JokeRe: problem in generating crysatl reports Pin
T.EDY29-Jul-07 23:57
T.EDY29-Jul-07 23:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.