Adding Buttons To Side Of Window On Windows Form

前端 未结 2 952
一生所求
一生所求 2021-01-29 11:07

I would like to add buttons to side of my windows form on C# (in outside). The buttons should move together as soon as when the window was moved.

For e

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-29 11:40

    I believe the anchor property on the button is what you are looking for. Anchor behaves on a control by making the control follow the edge it is anchored to. For example, if you anchor to the bottom and you make your window bigger by dragging it from the bottom, the control will move down your form. You are able to anchor to multiple edges as well. Dock could also be used, which would cause your buttons to expand in size but not necessarily move around.

    See this post for anchor vs dock.

提交回复
热议问题