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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -