Make portion of a Label's Text to be styled bold

前端 未结 12 618
离开以前
离开以前 2020-11-30 12:12

Is there any way to make a part of a label.text to be bold?

label.text = \"asd\" + string;

Would like the string

12条回答
  •  星月不相逢
    2020-11-30 12:46

    WebForms

    Use Literal control, and add a tag around the part of the text you want:

    _myLiteral.Text = "Hello big world";

    Winforms

    Two options:

    1. Put two labels side by side (far easier)
    2. Subclass Label and do your own custom drawing in the OnPaint() method.

    The second choice has been answered already.

提交回复
热议问题