Macin
Macin

Reputation: 391

Resize control on Main Form resize (WPF, C#)

I created a user control which is a Grid of TextBlocks with fixed height rows and fixed width each. I place this control on a main form. Then on the run time I read current height of the control and based on this value I calculate number of rows to display. Now, the problem is, when I resize main form: how can I update number of rows based on the new height of the main form?

edit: saying Grid of textblocks I meant a grid layout of texblocks

Upvotes: 0

Views: 646

Answers (1)

Rachel
Rachel

Reputation: 132618

Add a handler to the Window.SizeChanged event and re-size your Grid there

Upvotes: 2

Related Questions