I am using the following code to override and draw each list item within a ListBox.
if (e.Index < 0) return;
// if the item state is selected then change the back color
if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
e = new DrawItemEventArgs(e.Graphics,
e.Font,
e.Bounds,
e.Index,
e.State ^ DrawItemState.Selected,
e.ForeColor,
Color.Red); // Choose the color
// Draw the background of the ListBox control for each item.
e.DrawBackground();
// Draw the current item text
e.Graphics.DrawString(studentsListBox.Items[e.Index].ToString(), e.Font, Brushes.Black, e.Bounds, StringFormat.GenericDefault);
// If the ListBox has focus, draw a focus rectangle around the selected item.
e.DrawFocusRectangle();
The code is works as I would suspect, however I would also like to add a border to the entire drop-down portion of the list box (see the example image below.) How can I add the border to the entire list?

Since the title is referring to the border, I’ll focus on that. I’m assuming you want to change the BorderStyle beyond just the given “None”, “FixedSingle” and “Fixed3D”?
The ListBox does not support any kind of BorderColors, etc.
Your best bet is to change change the
BorderStyle to "None",IntegralHeight = False, andDock = Fill, and then place it inside a panel.For your panel, change
BorderStlye = None,Padding (All) = 2,BackColor = Red.With WinForms, your choices are limited.