Q&A #18 – NaN for a Windows Phone Textbox Height

NaN for a Windows Phone Textbox Height

Did you know that you can set the value of the height property to “NaN” for a Windows Phone textbox?

The Textbox height property accepts double value but can also accept “NaN”.

By specifying this, we can specify the auto size property for the textbox. Alternatively, you can also set this value to “Auto” too.

<TextBox Margin="14,15,0,0" Name="textBox1" Height="NaN" />
<TextBox Margin="14,15,0,0" Name="textBox1" Height="Auto" />

Leave a Reply