private int GetVisibleRowCount(bool hScroll, bool vScroll)
{
int count;
if (this.EnableWordWrap)
count = this.VisibleRowCountExact();
else
{
Rectangle clientRect = this.InternalBorderRect;
if (hScroll)
{
clientRect.Height -= SystemInformation.HorizontalScrollBarHeight;
}
if (vScroll)
{
clientRect.Width -= SystemInformation.VerticalScrollBarWidth;
}
if (this.HeaderStyle != ColumnHeaderStyle.None && this.ColumnCount > 0)
{
clientRect.Y += this.HeaderHeight;
clientRect.Height -= this.HeaderHeight;
}
count = clientRect.Height / this.RowHeight;
}
return count;
}