Just rewrite the text box template like
<ControlTemplate TargetType="Textbox"> <Path ... define your triangle here> </ControlTemplate>
and then set the input property in the text box to true. also align the continuation. Hor. and vert. ALG. thus, it is centered in the middle of the triangle. make sure you make the background of the text field transparent so that it does not overwrite the borders of the triangle.
also, if you do not want to go beyond, place the content presenter in the viewport.
You can also see the property of the clip.
source share