Friday, 17 December 2010

WinForms Dock=Fill in WPF

Today while designing a WPF form, I was using a TabControl and wanted to fill it entirely on the window.

In WinForms we would reach out to the Dock property of TabControl and select 'Fill'. However we do not have Dock property in WPF controls.

Solution: We can use the alignment properties to achieve the same effect:

<TabControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />

You will need to remove Height, Width and Margin properties of the control to make it fill.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Shorts - week 3, 2022

Post with links to what I am reading: 1. A very good post on different aspects of system architecture: https://lethain.com/introduction-to-a...