Skip to main content

How to: Create New Vertical ScrollBar at Runtime

The following sample code demonstrates how to create and place onto a form a new vertical scroll bar at runtime.

// Create and initialize an VScrollBar
DevExpress.XtraEditors.VScrollBar vbar = new DevExpress.XtraEditors.VScrollBar();
vbar.Height = 100;
vbar.Top = 20;
vbar.Left = 20;
// Add the scroll bar to the form
Controls.Add(vbar);