Skip to content

TabPage with HTML Text #1280

Closed
Closed

Description

@itg-assistant

Harald Bacik asked 2017-12-31 13:01:29 UTC

Hey

How can I display the TabPage Text with HTML Tag?

TabPage does not seem to provide "AllowHTML" property

Please give me some information to this.

THX and have a happy new year

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-12-31 21:32:07 UTC

    You can create a custom TabPageHtml class like this:

    public class TabPageHtmlText : TabPage
    {
      protected override void OnWebRender(dynamic config)
      {
        base.OnWebRender((object)config);
    
        // escape the html text.
       config.caption = TextUtils.EscapeText(this.Text, true /* allowHtml */, this.UseMnemonic, false);
       }
    }
    

    All it needs is to escape the html text differently to allow for html tags.

    Be careful with the html since the tab buttons may not be able to fully adjust their size. See small test below using tabPage4.

  2. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Harald Bacik answered 2018-01-01 14:05:25 UTC

    Cool Stuff!

    Thx, works 100% fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions