Back to Devexpress

How to: Create and Place Onto Form Horizontal Scroll Bar at Runtime

windowsforms-9488-controls-and-libraries-editors-and-simple-controls-examples-how-to-create-and-place-onto-form-horizontal-scroll-bar-at-runtime.md

latest654 B
Original Source

How to: Create and Place Onto Form Horizontal Scroll Bar at Runtime

  • Oct 25, 2019

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

csharp
using DevExpress.XtraEditors;
// ...
DevExpress.XtraEditors.HScrollBar hbar = new DevExpress.XtraEditors.HScrollBar();
hbar.Width = 100;
hbar.Top = 20;
hbar.Left = 20;
Controls.Add(hbar);
vb
Imports DevExpress.XtraEditors
' ...
dim hbar as new DevExpress.XtraEditors.HScrollBar()
hbar.Width = 100
hbar.Top = 20
hbar.Left = 20
Controls.Add(hbar)