wpf - How to make Label Text Underline? -
how can make label
text underline
in wpf? stucked , not find property underline:
<label name="lblusername" content="username" fontsize="14" fontweight="medium" />
in label
no textdecorations
, therefore try this:
<label width="100" height="30"> <textblock textdecorations="underline">testtext</textblock> </label>
edit: more universal solution
in case, instead of label.content
using label.tag
, because content property can set once:
<label tag="testcontent" width="100" height="30" horizontalcontentalignment="center" background="aliceblue"> <textblock textdecorations="underline" text="{binding path=tag, relativesource={relativesource mode=findancestor, ancestortype={x:type label}}}" /> </label>
Comments
Post a Comment