Panel Autoscroll Maximum Value

﹥>﹥吖頭↗ 提交于 2019-12-24 18:13:04

问题


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);
}

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 ?


回答1:


The autoscroll are is not the issue.

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.

If you call BringToFront on the last button, it will become visible.



来源:https://stackoverflow.com/questions/7175807/panel-autoscroll-maximum-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!