Dev Label显示不同颜色字体

labelControl1.Text = "<size=14>Size = 14<br>" +
                     "<b>Bold</b> <i>Italic</i> <u>Underline</u><br>" + 
                     "<size=11>Size = 11<br>" + 
                     "<color=255, 0, 0>Sample Text</color></size>" +
                     "<href=www.devexpress.com>Hyperlink</href>";
labelControl1.AllowHtmlString = true;
labelControl1.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
labelControl1.Appearance.Options.UseTextOptions = true;
labelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;

private void labelControl1_HyperlinkClick(object sender, DevExpress.Utils.HyperlinkClickEventArgs e) {
    System.Diagnostics.Process.Start(e.Link);
}

原文连接:

https://documentation.devexpress.com/WindowsForms/DevExpress.XtraEditors.LabelControl.class

https://documentation.devexpress.com/WindowsForms/DevExpress.XtraEditors.LabelControl.AllowHtmlString.property

 


 

posted @ 2018-11-20 10:38  以沫浅夏  阅读(1050)  评论(0编辑  收藏  举报