TableLayoutPanel scroll bar issues

  • Thread starter Thread starter rino
  • Start date Start date
R

rino

Hi .
I am using a table layout panel with autoscroll = true
I found several issues which dont seem to work properly
1. when I have more rows then in view and the vertical scroll bar is added
it sometimes also adds the Horizontal scroll bar because it doesnt adjust the
width properly and the scrollbar takes up part of the client area. This isnt
consistent, sometimes the horizontal appears and sometimes it doesnt .
2. I have noticed something funny . I want to remove and add a control and
while doing that I want to maintain the scroll position so I do

int prevVal = m_TableLayoutPanel.VerticalScroll.Value;

..... ADD AND REMOVE

m_TableLayoutPanel.VerticalScroll.Value = prevVal;

The funny thing is that if I call athe above line once it doesnt change the
VerticalScroll.Value . IF I call it TWICE then the second time it does change
the Value.
so my code looks like this

m_TableLayoutPanel.VerticalScroll.Value = prevVal;
m_TableLayoutPanel.VerticalScroll.Value = prevVal;

Andy idea why this happens ?????????
 
Back
Top