c# - Opacity Mask Direction Top to Bottom? -


i fade text of wpf textbox top down. not left right. there way in xaml? below have far

<textbox x:name="txtdesc" text="{x:static model:carmanager.desc}" verticalalignment="top" horizontalalignment="left" textwrapping="wrap" verticalscrollbarvisibility="auto"  width="466"  fontweight="bold" height="263" margin="304,195,0,0" borderbrush="{x:null}" borderthickness="0" background="{x:null}">         <textbox.foreground>             <lineargradientbrush endpoint="0.5,1" startpoint="0.5,0">                 <gradientstop color="#ff8f8f8f" offset="0"/>                 <gradientstop color="white"/>             </lineargradientbrush>         </textbox.foreground>         <textbox.opacitymask>             <lineargradientbrush startpoint="0,0" endpoint="1,0">                 <gradientstop offset="0" color="whitesmoke"></gradientstop>                 <gradientstop offset="1" color="transparent"></gradientstop>             </lineargradientbrush>         </textbox.opacitymask>     </textbox> 

this fades text left right..i fade top down.

thank help

use this

    <textbox x:name="txtdesc" text="{x:static model:carmanager.desc}" verticalalignment="top" horizontalalignment="left" textwrapping="wrap" verticalscrollbarvisibility="auto"  width="466"  fontweight="bold" height="263" margin="304,195,0,0" borderbrush="{x:null}" borderthickness="0" background="{x:null}">         <textbox.foreground>             <lineargradientbrush endpoint="0.5,1" startpoint="0.5,0">                 <gradientstop color="#ff8f8f8f" offset="0"/>                 <gradientstop color="white"/>             </lineargradientbrush>         </textbox.foreground>         <textbox.opacitymask>             <lineargradientbrush startpoint="0.5,0" endpoint="0.5,1">                 <gradientstop offset="0" color="whitesmoke"></gradientstop>                 <gradientstop offset="1" color="transparent"></gradientstop>             </lineargradientbrush>         </textbox.opacitymask>     </textbox> 

Popular posts from this blog