富文本框中的过去文本 不带格式的视觉C++
Past text in rich text box Visual C++ without formating
我正在做我的项目,我正在为自己制作记事本。目前我处于最终状态(修复错误并添加一些最终内容)。我现在面临的问题是:当我粘贴格式化文本时,它会保持格式化,我希望它未格式化,默认字体,默认大小。我在Visual 2010 C++Microsoft工作。我用于粘贴的代码:
private: System::Void pasteToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
richTextBox1->Paste();
}
Paste
方法具有此重载,该重载采用指定粘贴数据格式的参数。指定所需的格式,如 DataFormats::Text
或 DataFormats::UnicodeText
。例如:
// Get the format for the object type.
DataFormats::Format^ myFormat = DataFormats::GetFormat( DataFormats::Text );
// After verifying that the data can be pasted, paste it.
if ( richTextBox1->CanPaste( myFormat ) )
{
richTextBox1->Paste( myFormat );
return true;
}
else
{
MessageBox::Show( "The data format that you attempted to paste is not supported by this control." );
return false;
}
相关文章:
- 如何检查字符串格式在读取C++文本文件时是否有效?
- 为什么使用 C++ 中的类对象写入文件中的数据以非文本格式存储?
- QT 标签 setText() 同时保留文本格式
- 输出使用 cout 转换为 ASCII 的文本时输出格式不正确,C++
- 如何设计对象以不同方式设置文本格式
- 使用文本格式来记录QT
- 如何将percision格式复制到文本文件
- C :如何从格式的文本文件中读取许多数据到程序中
- 使用无符号字符设置文本格式
- 阅读文本格式不一致
- 要求文本编辑,文本格式
- 将大型数据文件拆分为多个小文件(文本格式)
- 在 C++/Qt 中以文本格式序列化数据结构
- 如何在解析文本格式的 protobuf 消息时忽略错误的字段
- C++:将输出文本格式化为.doc/.docx/.rtf(第2部分)
- 将输出文本格式化为.doc/.docx
- C++ 使用 setw 的文本格式不适用于 QT 的 QTextEdit
- QTextEdit显示的块中图像后的文本格式
- 从流中读取十六进制文本格式0x
- QProgressBar文本格式为时间