Moving from WinForms to WPF

1) TabControl:

- How to set the title on the TabItem control?

In WinForms we used the Text property, in WPF we have the Header property. The header property is of type object, so basically we can put 'anything' in the header - not just text.

2) TextBox:

- How to add scrollbar to TextBox?

Add these properties: HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Auto"

3) Button:

- How to write a multi-line text on the button?

As expected this doesn't work
<Button.Content> Hello\rthere<Button.Content/>

We need to use a TextBlock as Content, and use a <LineBreak /> in the text.

For e.g.:
<TextBlock>Test<LineBreak/> button</TextBlock>






Comments

Popular posts from this blog

Wix: How to hide the License Agreement dialog in Mondo UI

WPF: TreeView example (Part 4)