This works initially - so if I populate the table then show the form dialog there is only a vertical scrollbar. Once I add something to the table after showing the form the vertical scrollbar disappears. If I change the AutoScroll to $true the initial panel is also correct (only the vertical scroll shows) but once I add to the table the scrollbars are reset - showing both the vertical and horizontal bars. It is as if the VerticalScroll settings and the HorizontalScroll settings are not persisted. How can I hide the horizontal scroll bar?
That’s really all controlled from within the WinForm control itself, unfortunately. I’m not sure you could influence that behavior more than you already have.
Notice that AutoScroll is on. If you run this script as is the TableLayoutPanel will only show the vertical scroll bar; push the “Add” button as many times as you want and you will see the table has new entries at the end and the scroll bar remains only showing the vertical scroll bar. The problem is that the TableLayoutPanel I am working with does not have ANY initial data on it so essentially the “LINE OF INTEREST!!!” becomes a 0 for the $j bounding value. Change that value to zero so the line reads “for ($j=0; $j -lt 0; $j++){ # LINE OF INTEREST!!!” and then run the script (notice the table is empty. Press the “Add” button (notice no scroll bars show up until they are needed which is not a problem). Fill the table so that the vertical scroll bar is needed and you will see that BOTH the vertical and horizontal scroll bars appear - I ONLY want the vertical scroll bar not the horizontal - so my question is how to hide the horizontal scroll bar? Thanks!