private void VerticalScrollBar_VisibleChanged(object sender, EventArgs e) { if (!DesignMode && !VerticalScrollBar.Visible) { VerticalScrollBar.Location = new Point(ClientRectangle.Width - VerticalScrollBar.Width, 0); VerticalScrollBar.Size = new Size(VerticalScrollBar.Width, ClientRectangle.Height); VerticalScrollBar.Show(); } }
void VerticalScrollBar_VisibleChanged(object sender, EventArgs e) { if (!VerticalScrollBar.Visible) { VerticalScrollBar.Location = new Point(ClientRectangle.Width - VerticalScrollBar.Width, 1); VerticalScrollBar.Size = new Size(VerticalScrollBar.Width, ClientRectangle.Height - 1);// - HorizontalScrollBar.Height); VerticalScrollBar.Show(); } VerticalScrollBar.Visible = true; }
private void ShowScrollBars(object sender, EventArgs e) { if (!VerticalScrollBar.Visible) { int width = VerticalScrollBar.Width; VerticalScrollBar.Location = new Point(ClientRectangle.Width - width - BORDERWIDTH, CAPTIONHEIGHT); VerticalScrollBar.Size = new Size(width, ClientRectangle.Height - CAPTIONHEIGHT - BORDERWIDTH); VerticalScrollBar.Show(); } }
private void ShowScrollBars(object sender, EventArgs e) { if (!VerticalScrollBar.Visible) { int width = VerticalScrollBar.Width; //if (isFirst) //{ // Width -= width; // isFirst = false; //} VerticalScrollBar.Location = new Point(ClientRectangle.Width - width - 1, 1); VerticalScrollBar.Size = new Size(width, ClientRectangle.Height - 1); VerticalScrollBar.Show(); // AutoResizeColumns(); //MessageBox.Show(width.ToString()); //SuspendLayout(); //foreach (DataGridViewColumn c in Columns) //{ // c.Width -= 4; //} //ResumeLayout(); } }