面板自动滚动最大值 [英] Panel Autoscroll Maximum Value
问题描述
我创建窗体并添加具有自动滚动功能的面板为true;
I create Form and I add Panel with Autoscroll is true;
之后,我添加此代码;
After than , I Add this code;
Int32 _y =0;
progressBarX1.Maximum = 600;
for (int i = 0; i <= 600;i++ )
{
progressBarX1.Value = i;
ButtonX _btn = new ButtonX();
_btn.Click += new EventHandler(_btn_Click);
_btn.Width = 100;
_btn.Visible = true;
_btn.Height = 70;
_btn.Text = i.ToString();
_btn.Left = 0;
_btn.Top = _y;
_y += 80;
panel1.Controls.Add(_btn);
}
我运行了该项目,但是在面板中我只看到407按钮,我无法使用vscroll向下移动.面板上未显示所有其余按钮.但是代码是在面板上添加按钮.我检查Tab和按钮是否在那里.我认为问题是面板滚动.最大高度是32500 aproxilamte.因此,Vscroll最多可以将此32500值降低.
I run the project, but in Panel I see just 407 button, I can not move down with vscroll. All rest buttons doesnt show in panel. But the code is add button to panel. And I check with Tab and buttons are there. The problem Panel Scrolling are I think. Max Height is 32500 aproxilamte. So Vscroll down max this 32500 value.
如何增加自动滚动高度"区域?
How Can I increase the Autoscroll Height area ?
推荐答案
自动滚动不是问题.
不幸的是,对于x或y,控件的最大位置是32767. 因此,面板在最高位置将所有按钮相互绘制.
Unfortunately the maximum location for a control is 32767 for either x or y. So the panel is drawing all the buttons on top of each other at the highest location.
如果在最后一个按钮上调用BringToFront,它将变为可见.
If you call BringToFront on the last button, it will become visible.
这篇关于面板自动滚动最大值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!