如何使用按钮滚动FlowLayout面板 [英] How to Scroll a FlowLayout Panel with Using Buttons
本文介绍了如何使用按钮滚动FlowLayout面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
伙计们,
如何使用两个按钮滚动FlowLayout面板。我的FlowLayout面板包含带有图片框的UserControls。我想用两个按钮向上滚动它们&下。我就是这样,
私人 void BtnProdUp_Click( object sender,EventArgs e)
{
this .FlowProducts .VerticalScroll.Value = this .FlowProducts.VerticalScroll.LargeChange - 1 ;
FlowProducts.PerformLayout();
}
private void btnProdDown_Click(< span class =code-keyword> object sender,EventArgs e)
{
this .FlowProducts。 VerticalScroll.Value = this .FlowProducts.VerticalScroll.LargeChange + 1 ;
FlowProducts.PerformLayout();
}
我不想要FlowLayout Panel中的滚动条。我的COED不能正常工作请帮助我非常紧急。
解决方案
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 requiredprivate 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.
这篇关于如何使用按钮滚动FlowLayout面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文