I am use to working with windows forms, but recently I had started to work on WPF.
But I got into trouble when trying to anchor elements, the only solution I found online was to use the Dock element.
(It hadn’t worked) On top of that I want some of my elements to behave like the anchor=right,left, button.
How can I do so?(for a tab control).
I am use to working with windows forms, but recently I had started to
Share
There is no “anchoring” in WPF like there was in WinForms. WPF has many options to control your layout and uses a combination of layout containers:
DockPanel,Grid,StackPanel, etc. And layout attributes likeHorizontalAlignment,VerticalAlignment, etc.I would suggest that you read up on things on the layout containers,
DockPanel,Grid, andStackPanelbeing the most popular (at least in my experience).On the upside, I’ve personally found the layout system in WPF to much better and powerful than WinForms, once you get the hang of it.