且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用按钮滚动FlowLayout面板

更新时间:2023-11-30 16:05:04

1。使用设置插入FlowLayoutControl:



Dock = DockStyle.None;

AutoScroll = false;

AutoSize = true;

WrapContents = true;

FlowDirection = TopDown



2.进入面板大小按要求
  private   const   int  VerticalStep =  40 ; 

private void BtnProdUp_Click( object sender,EventArgs e)
{
FlowProducts.Top - = VerticalStep;
}

private void btnProdDown_Click( object sender,EventArgs e)
{
FlowProducts.Top + = VerticalStep;
}

我想考虑的另一个选择是通过鼠标点击拖动使FlowLayoutPanel移动到它位于的面板中......但是,这需要......时间。


Guys,
How Can I scroll a FlowLayout Panel With Using Two Buttons. My FlowLayout Panel Contains UserControls With Picture Boxes. I want to SCroll them Using Two Buttons UP & Down. My is Just Like This,

private void BtnProdUp_Click(object sender, EventArgs e)
        {
                this.FlowProducts.VerticalScroll.Value = this.FlowProducts.VerticalScroll.LargeChange - 1;
                FlowProducts.PerformLayout();

        }

        private void btnProdDown_Click(object sender, EventArgs e)
        {

                 this.FlowProducts.VerticalScroll.Value = this.FlowProducts.VerticalScroll.LargeChange + 1;
                 FlowProducts.PerformLayout();

        }


I dont want Scroll Bar in FlowLayout Panel. My COde Dosen't Work Properly Please Help me Its Very Urgent.

1. insert the FlowLayoutControl with settings:

Dock = DockStyle.None;
AutoScroll = false;
AutoSize = true;
WrapContents = true;
FlowDirection = TopDown

2. into a Panel sized as required
private const int VerticalStep = 40;

private void BtnProdUp_Click(object sender, EventArgs e)
{
    FlowProducts.Top -= VerticalStep ;
}

private void btnProdDown_Click(object sender, EventArgs e)
{
    FlowProducts.Top += VerticalStep ;
}

An alternative I would consider would be to make the FlowLayoutPanel movable by mouse click-drag in the Panel it is sited within ... but, that would take ... time.