WPF Window - Only allow horizontal resize

后端 未结 8 1208
一生所求
一生所求 2021-01-03 23:02

I want to only allow my WPF window to be resized horizontally. How best can I achieve this?

8条回答
  •  遥遥无期
    2021-01-03 23:34

    It's kind of a pain. Basically you need to set up a hook function to process windows messages. Then you would catch the WM_SIZING (0x0214) message and modify the parameters so that the horizontal dimension could not be changed.

    Pete Brown also has some great info on this topic on his blog.

提交回复
热议问题