I’ve tabcontrol with 3 pages. Within the tabpages are placed listviews. The listviews can be bigger than the tabpage itself.
I wanna add scrollbars on the tabpages
I tried to solve this with the following source:
lvwAlbums.Parent = pctlDatabeheer.TabPages[1];
lvwAlbums.Left = 0;
lvwAlbums.Top = 0;
lvwAlbums.Width = pctlDatabeheer.TabPages[1].Width - 35;
lvwAlbums.Height = 1000;// pctlDatabeheer.TabPages[1].Height;
lvwAlbums.SmallImageList = iltListView;
lvwAlbums.FullRowSelect = true;
lvwAlbums.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
foreach (TabPage _Page in pctlDatabeheer.TabPages)
{
_Page.AutoScroll = true;
_Page.AutoScrollMargin = new System.Drawing.Size(20, 20);
_Page.AutoScrollMinSize = new System.Drawing.Size(_Page.Width, _Page.Height);
}
But the scroll are not shown. What do I wrong?
Can anybody help me?
Thank yopu for your help.
I created a new Visual Studio WinForms project. Kept the form designer completely empty and used your code:
Works perfectly fine. I suspect you have something else wrong but I can’t see that or troubleshoot it without seeing your code.
EDIT: Now that you posted some more code, your issue is with your list box:
Don’t anchor the control to the bottom. That is causing you the issue. You cannot anchor to the bottom and then scroll. The other anchors are fine.