Monday, 9 August 2010

Create a Multiline TextBox Control using WPF [WPF – Multiline Text Box]

In windows applications we set the “Multiline” property to “true” in order to make a textbox multiline. But in WPF, there’s no property called “Multiline”. In order to make textbox multiline in WPF, you have to set three properties. That is :

  • TextWrapping=”Wrap”
  • VerticalScrollBarVisibility=”True”
  • AcceptsReturn=”True”

 

E.g

<TextBox Name="txtaddress" 
TextWrapping="Wrap"
VerticalScrollBarVisibility="Visible"
AcceptsReturn="True"/>







No comments:

Post a comment