Selectionbrush property with only edge and no padding

Asked

Viewed 52 times

0

It is possible to make the property SelectionBrush same as the image below:

inserir a descrição da imagem aqui

'Cause she’s like this now:

inserir a descrição da imagem aqui

Follows code:

<TextBox SelectionBrush="Red" FontSize="12pt"/>

I want it only the border and without equal fill in the first image, has how to do it in WPF ?

  • Maybe drawing a Rectangle and then paint the border? And yet I think it would be enough Tricky!

  • @Joãomartins do not know, will be cool ?

  • Cute could stay, but it will be quite difficult to do this, more because of the position of the text that may vary.

  • @Joãomartins you have an example of the code ? For me to have a notion.

  • The check must be a TextBox?

  • @Joãomartins.

Show 2 more comments

1 answer

-1

You can set the edge properties in the textbox itself:

<TextBox x:Name="TbTeste" BorderThickness="2" BorderBrush="Red"/>
  • Where did you define this code ?

  • Doesn’t work with textbox

  • I changed the example colleague, see if now meets you

  • It is not to paint the edge of the TextBoxand rather paint SelectionBrush.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.