gpt4 book ai didi

c# - 将文本拖放到文本框和特殊字符中

转载 作者:太空宇宙 更新时间:2023-11-03 20:27:47 25 4
gpt4 key购买 nike

我为 TextBox 控件提供了拖放支持,但这里有一些字符集问题(在特殊字符上)。

如果我将该文本放到我的控件上:

Cześć, chciałbym przetestować specjalne polskie znaki.

它变成了:

Cześć, chciałbym przetestować specjalne polskie znaki.

这是我的 DragDrop 代码:

private void textBox_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.Text))
{
TextBox txt = (TextBox)sender;
txt.Text = (string)e.Data.GetData(DataFormats.Text);;
}
else e.Effect = DragDropEffects.None;
}

当我粘贴数据时,一切似乎都正常。

最佳答案

您是否尝试过 DataFormats.UnicodeText 而不是 DataFormats.Text

关于c# - 将文本拖放到文本框和特殊字符中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9444334/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com