Show always horizontal and vertical scrollbar in a datagridview

  • Thread starter Thread starter ChrisHar
  • Start date Start date
C

ChrisHar

Guest
How can i do it?

I'm using the code below to show the vertical scrollbar permanently but when i play around for the location and the size of the horizontal scrollbar my visual studio crashes.

Regards



public MyGridView()
{
VerticalScrollBar.Visible = true;

VerticalScrollBar.VisibleChanged += new EventHandler(ShowVScrollBars);
}

private void ShowVScrollBars(object sender, EventArgs e)
{
if (!VerticalScrollBar.Visible)
{
int width = VerticalScrollBar.Width;
VerticalScrollBar.Location = new Point(ClientRectangle.Width - width - 1, 1);
VerticalScrollBar.Size = new Size(width, ClientRectangle.Height - 2);
VerticalScrollBar.Show();
}
}

Continue reading...
 
Back
Top