开发者

C# problem with scrolling to end of UserControl with large amount of content

I've created UserControl that contains bunch of other controls that are placed also outer area of visible part of my control to cause vertical scrollbar to appear, as expected and required behaviour.

Everything works as it should untill size, amount and location of controls doesn't exceed some value. I say some cause i couldn't determine which value i exceed and by that I cause my control work not quite well.

Amount of controls inside my UserControl can vary from few to few thousands, depending on circumstances. Controls are same size, displayed in rows/columns. Number of rows, and columns that user see in visible part of UserControl depends on size of controls inside. As far as i know it should be possible for me to operate on values of location as big as max value of int. But it seems that im doing something wrong, cause while tests things doesn't work as it should.

While the Location.Y value of control at the bottom of my UserControl is for example 49150 scrolling of control doesn't bring me nowhere near that value VScrollBar.maximum no matter how much controls i put and how far their Y location would be never go bigger than 32896.

When i change size of my UserControl or size of controls inside, so the Location.Y of last control isn't too far, everything works great.

Is there any way that i can fix VScrollBar, or do anything else to get my control work exactly as I need it, or anything else that could cause such pr开发者_运维问答oblem?

MTH


It looks like that is the size limit based on when winforms was originally created back when everything was 16 bit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜