Vertically (only) resizable windows form in C#

前端 未结 6 1528
时光取名叫无心
时光取名叫无心 2020-12-04 14:55

I have a situation where it would be beneficial to me to allow my windows form to be resized by the user, but only vertically. After some searching, it seems like there isn\

6条回答
  •  佛祖请我去吃肉
    2020-12-04 15:04

    Let the FormBorderStyle to Resizable and set MaximumSize and MinimumSize = new Size(this.Width, 0)

    Correction:

    this.MinimumSize = new Size(this.Width, 0);
    this.MaximumSize = new Size(this.Width, Int32.MaxValue);
    

提交回复
热议问题