1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-12 05:34:06 +02:00

Add RichTextLabel.Wrap for default RTF text formatting

This commit is contained in:
chylex 2016-04-09 17:48:45 +02:00
parent 2c2eea05ad
commit 5e5343b7d6

View File

@ -3,6 +3,16 @@
namespace TweetDick.Core{
public partial class RichTextLabel : RichTextBox{
/// <summary>
/// Wraps the body of a RTF formatted string with default tags and formatting.
/// </summary>
public static string Wrap(string str){
string rtf = @"{\rtf1\ansi\ansicpg1250\deff0\deflang1029{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}";
rtf += @"{\*\generator Msftedit 4.20.69.1337;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang1036\f0\fs20 ";
rtf += str;
return rtf;
}
public RichTextLabel(){
InitializeComponent();