如何在面板的FlowLayout无需滚动显示窗口滚动条的形式 [英] How to scroll in flowlayout panel without showing scrollbar in windows form
本文介绍了如何在面板的FlowLayout无需滚动显示窗口滚动条的形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在WinForms的触摸屏POS工作。
我有一个FlowLayoutPanel的和动态添加按钮,但我不希望显示滚动条。
我用2个按钮,而不是滚动,所以请帮助我如何不显示滚动条
解决方案滚动DIV>
取两个按钮btnLeft和btnRight和尝试这个代码:
私人无效btnLeft_Click(对象发件人,EventArgs的发送)
{
如果(flowPanelItemCategory.Location.X< = XPOS)
{
XMIN = flowPanelItemCategory.HorizontalScroll.Minimum;
如果(flowPanelItemCategory.Location.X> = XMIN)
{
XPOS - = 100;
flowPanelItemCategory.Location =新的点(XPOS,0);
}
}
}
私人无效btnRight_Click(对象发件人,EventArgs五)
{
如果(flowPanelItemCategory.Location.X< = XPOS)
{
XMAX = flowPanelItemCategory.HorizontalScroll.Maximum;
如果(flowPanelItemCategory.Location.X< XMAX)
{
+ XPOS = 100;
flowPanelItemCategory.Location =新的点(XPOS,0);
}
}
}
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 scroll instead, so please help me how to scroll without showing a scrollbar
解决方案
Take two buttons btnLeft and btnRight and try this code :
private void btnLeft_Click(object sender, EventArgs e)
{
if (flowPanelItemCategory.Location.X <= xpos)
{
xmin = flowPanelItemCategory.HorizontalScroll.Minimum;
if (flowPanelItemCategory.Location.X >= xmin)
{
xpos -= 100;
flowPanelItemCategory.Location = new Point(xpos, 0);
}
}
}
private void btnRight_Click(object sender, EventArgs e)
{
if (flowPanelItemCategory.Location.X <= xpos)
{
xmax = flowPanelItemCategory.HorizontalScroll.Maximum;
if (flowPanelItemCategory.Location.X < xmax)
{
xpos += 100;
flowPanelItemCategory.Location = new Point(xpos, 0);
}
}
}
这篇关于如何在面板的FlowLayout无需滚动显示窗口滚动条的形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文