Back to Devexpress

How to: Create New Vertical ScrollBar at Runtime

windowsforms-9528-controls-and-libraries-editors-and-simple-controls-examples-how-to-create-new-vertical-scrollbar-at-runtime.md

latest725 B
Original Source

How to: Create New Vertical ScrollBar at Runtime

  • Oct 25, 2019

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

csharp
// 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);
vb
' Create and initialize an VScrollBar
dim vbar as new DevExpress.XtraEditors.VScrollBar()
vbar.CreateControl()
vbar.Width = 100
vbar.Top = 20
vbar.Left = 20
' Add the scroll bar to the form
Controls.Add(vbar)