Cómo determinar la altura de línea de un cuadro de texto en píxeles en WinRT
Frecuentes
Visto 241 equipos
1
How do I determine the height of the lines of a TextBox in pixels in WinRT?
With Windows Phone, I could get (or set) this value through TextBox.LineHeight
, but this doesn't seem to be available to WinRT.
I can't work out how to do this, but I need to get the value so that I can set my padding and margins correctly in my layout. I'm trying to set the upper and lower padding to ((TextBox.Height
- TextBox.LineHeight
) / 2). Can anyone offer any suggestions?
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas c# xaml textbox windows-runtime or haz tu propia pregunta.
From the sounds of it, there may be a better way all together to do what you're trying to do that wouldn't/shouldn't involve actively looking at lineheights to set margins/padding elsewhere. - Chris W.
Could you provide an example? I'm trying to keep the active line in the middle of the screen through a combination of setting the padding and using
ChangeView
enScrollViewer
de laTextBox
to center the active line. - user3651656