kingjamez
asked on
Parsing a RichText Box like a file?
I am trying to parse email. I have created a richtext box that allows me to drag and drop an email file over it and the email appears in the RichText Box. I want to be able to step through that RichText Box line by line and parse it. Can I use similar commands for stepping through a file to step through the RichText Box? Here is the code that I used to drag and drop the email file into the RichText Box.
private void Form1_Load(object sender, System.EventArgs e)
{
this.richTextBox1.DragEnte r += new System.Windows.Forms.DragE ventHandle r(this.ric hTextBox1_ DragEnter) ;
this.richTextBox1.DragDrop += new System.Windows.Forms.DragE ventHandle r(this.ric hTextBox1_ DragEnter) ;
this.richTextBox1.AllowDro p = true;
}
private void richTextBox1_DragEnter(obj ect sender, System.Windows.Forms.DragE ventArgs e)
{
if (((DragEventArgs)e).Data.G etDataPres ent(DataFo rmats.Text ))
((DragEventArgs)e).Effect = DragDropEffects.Copy;
else
((DragEventArgs)e).Effect = DragDropEffects.None;
}
private void richTextBox1_DragDrop(obje ct sender, DragEventArgs e)
{
richTextBox1.LoadFile((Str ing)e.Data .GetData(" Text"), System.Windows.Forms.RichT extBoxStre amType.Ric hText);
}
Thanks!
private void Form1_Load(object sender, System.EventArgs e)
{
this.richTextBox1.DragEnte
this.richTextBox1.DragDrop
this.richTextBox1.AllowDro
}
private void richTextBox1_DragEnter(obj
{
if (((DragEventArgs)e).Data.G
((DragEventArgs)e).Effect = DragDropEffects.Copy;
else
((DragEventArgs)e).Effect = DragDropEffects.None;
}
private void richTextBox1_DragDrop(obje
{
richTextBox1.LoadFile((Str
}
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.