.net - Can ListBox items span multiple lines? C# -
this question has answer here:
i'd have listbox control contain items span multiple lines.
essentially want each item span multiple lines , selectable 1 item. there way this?
as suggested larstech in comment, other comments lead kind of coded example may confuse you. made demo lines of code follow , started easily:
listbox1.drawmode = drawmode.ownerdrawvariable; //first add items listbox1.items //measureitem event handler listbox private void listbox1_measureitem(object sender, measureitemeventargs e) { if (e.index == 2) e.itemheight = 50;//set height of item @ index 2 50 } //drawitem event handler listbox private void listbox1_drawitem(object sender, drawitemeventargs e) { e.drawbackground(); e.graphics.drawstring(listbox1.items[e.index].tostring(), e.font, new solidbrush(e.forecolor), e.bounds); }