Appearance and Behavior Settings in WinForms Editable ListBox

27 Apr 20212 minutes to read

This section discusses the complete Appearance and behavior settings of EditableList control.

Embedded Controls

EditableList control contains embedded controls such as Button, TextBox and ListBox.

EditableList  Embedded controls Description
Button It includes the properties and events present in the windows Button.
TextBox It includes the properties and events present in the windows TextBox.
ListBox The listbox property of editable list, expands and allows the user to set various appearance and behavior properties of the EditableList.

Auto Scrolling

You can enable scrollbars automatically for the EditableList control when its items are shown beyond its size by setting AutoScroll to true. When AutoScroll is enabled for the control, you can set the margin and logical size for the autoscroll region by AutoScrollMargin and AutoScrollMinSize properties.

EditableList  Properties Description
AutoScroll It indicates whether Scrollbars will automatically appear if controls are placed outside the form's client area.
AutoScrollMargin It sets margin around the controls during AutoScroll.
AutoScrollMinSize It sets the minimum logical size for the AutoScroll region.
this.editableList1.AutoScroll = true;
this.editableList1.AutoScrollMargin = new System.Drawing.Size(2, 2);
this.editableList1.AutoScrollMinSize = new System.Drawing.Size(3, 3);
Me.editableList1.AutoScroll = True
Me.editableList1.AutoScrollMargin = New System.Drawing.Size(2, 2)
Me.editableList1.AutoScrollMinSize = New System.Drawing.Size(3, 3)

Dock Padding

Dock padding determines the size of the border for the docked controls.

EditableList  Property Description
DockPadding Gets the dock padding for all edges of the control.

The following image displays the EditableList control with the dock padding for all the edges set to 5.


this.editableList1.DockPadding.All = 5;
Me.editableList1.DockPadding.All = 5

Want Button

You can display the button to the right while editing the items in the EditableList control by setting WantButton to true.

EditableList  Property Description
WantButton Specifies whether to show button to the right while editing.


this.editableList1.WantButton = true;
Me.editableList1..WantButton = True