开发者

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

开发者 https://www.devze.com 2023-03-14 02:31 出处:网络
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 b

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 b开发者_如何学JAVAased on the new height of the main form?

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消