I just override the below method,
protected
override void OnDrawItem(DrawItemEventArgs e)
{
base.OnDrawItem(e);
this.DrawMode = DrawMode.OwnerDrawFixed;
e.DrawBackground();
// Define the default color of the brush as black.
SolidBrush foreBrush = new SolidBrush(e.ForeColor);
// Draw the current item text based on the current Font and the custom brush settings.
e.Graphics.DrawString(
this.Items[e.Index].ToString(), e.Font, foreBrush, e.Bounds, StringFormat.GenericDefault);
}
But even the string width exceeded the width of ListBox, there was no horizontal scroll bar.
How to solve the problem?
THx in advance.