hello everyone..
In my c# project I want to paste rtf text to wordpad from clipboard.I am using streamwriter for that.
I have three richtextbox and I am able to paste only first textbox data not others.
here is my code please help me...
Code: ( text )
StreamWriter sw = new StreamWriter("wpreview.wri");
for (int i = 0; i < count; i++)
{
child = clpbrd_panel.Controls["chkbox" + i];
if (child != null)
{
if (((CheckBox)child).Checked == true)
{
child = clpbrd_panel.Controls["rtextbox" + i];
((RichTextBox)child).SelectAll();
((RichTextBox)child).Copy();
idata = Clipboard.GetDataObject();
if (idata.GetDataPresent(DataFormats.Rtf))
{
sw.Write(idata.GetData(DataFormats.Rtf));
sw.WriteLine("");
}
}
}
sw.close();