How to scroll in flowlayout panel without showing scrollbar in windows form

前端 未结 2 850
灰色年华
灰色年华 2021-01-19 07:26

I am working on a touch screen POS in WinForms.

I have a flowlayoutpanel and add buttons dynamically but I dont want to show a scrollbar.

I use 2 buttons to

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-19 08:19

    Try placing the FlowLayoutPanel inside another panel with these properties:

    flowLayoutPanel1.AutoScroll = false;
    flowLayoutPanel1.AutoSize = true;
    flowLayoutPanel1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
    

    From here, you have to control yourself the location of the FlowLayoutPanel1 inside your panel (which should also have AutoScroll = false;) based on your two buttons.

提交回复
热议问题