ybt
asked on
C# copy data from html table in table format in textbox
In C# I have a WPF textbox in my form, a added a contextmenu:
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Cut" Click="menu_cut" />
<MenuItem Header="Copy" Click="menu_copy" />
<MenuItem Header="Paste" Click="menu_paste" />
</ContextMenu>
</TextBox.ContextMenu>
I have html table in browser that look as a picture "file1" in attachment
when I copy to *.doc I got as a picture "file2"
If I use code:
private void menu_paste(object sender, RoutedEventArgs e)
{
if (Clipboard.GetDataObject() .GetDataPr esent(Data Formats.Te xt) == true)
{
memo_text.Text = memo_text.Text + Clipboard.GetText(TextData Format.Tex t);
}
}
I got a picture "file3"
If I use code:
private void menu_paste(object sender, RoutedEventArgs e)
{
if (Clipboard.GetDataObject() .GetDataPr esent(Data Formats.Te xt) == true)
{
memo_text.Text = memo_text.Text + Clipboard.GetText(TextData Format.Htm l);
}
}
I got a picture "file5"
when I use *.doc intermediately and copy to textbox, result as picture "file4"
How can I get format as "file4" directly?
file1.JPG
file2.JPG
file3.JPG
file4.JPG
file5.JPG
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Cut" Click="menu_cut" />
<MenuItem Header="Copy" Click="menu_copy" />
<MenuItem Header="Paste" Click="menu_paste" />
</ContextMenu>
</TextBox.ContextMenu>
I have html table in browser that look as a picture "file1" in attachment
when I copy to *.doc I got as a picture "file2"
If I use code:
private void menu_paste(object sender, RoutedEventArgs e)
{
if (Clipboard.GetDataObject()
{
memo_text.Text = memo_text.Text + Clipboard.GetText(TextData
}
}
I got a picture "file3"
If I use code:
private void menu_paste(object sender, RoutedEventArgs e)
{
if (Clipboard.GetDataObject()
{
memo_text.Text = memo_text.Text + Clipboard.GetText(TextData
}
}
I got a picture "file5"
when I use *.doc intermediately and copy to textbox, result as picture "file4"
How can I get format as "file4" directly?
file1.JPG
file2.JPG
file3.JPG
file4.JPG
file5.JPG
I think you've missed referring to the file2.JPG in your question.
ASKER
You are right, I corrected, fil1 and file2 looks the same
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much, this is a new feature for me.