Thursday, 12 September 2013

Paste the Files present in any folder into Richtextbox

Paste the Files present in any folder into Richtextbox

I am having multiple format files(.jpeg,.txt,.doc,.excel) in a folder.I
want to show those file with their icon in richtextbox in c#.
string[] files = Directory.GetFiles(pp);
foreach (string file in files)
{
StringCollection paths = new StringCollection();
paths.Add(file); // Clipboard.
// Clipboard.SetFileDropList(paths);
// lst.Items.Add(file);
rht_attachment.Focus();
Clipboard.SetFileDropList(paths);
rht_attachment.Paste();
}

No comments:

Post a Comment