I need to create a table user control. The table will display many
cells so this control requires scrollbars should be displayed when some
cells cannot be displayed. At first, I draw the table on a UserControl,
and resized the UserControl to the exact size of table and placed it on
a Panel whose AutoScroll is true. So when the table(actually a
UserControl) gets bigger, the Panel displays scrollbars automaticaly,
this seemed fine.
But the problem is, I need to place controls like TextBox on some
cells. When the Panel's AutoScroll is set to true, if a TextBox gets
focused while some part of the TextBox is not in visible area , the
Panel automatically scrolls the table to display the whole TextBox.
This caused problems. The TextBox is not exactly displayed in the
location of the cell.
Anyways, that's why I'm trying to create a real scrollable table
control. I want to implement scrolling by myself. But I've never done
something like this before. So Is there any good articles or howtos I
can get started with? I need to know the basic concept of displaying
portion of an area of the entire visible area,. and update the portion
of area when user scrolls the scrollbar.
Thank you very much in advance!