c# - Using User Control inside Listbox or Listview on WinForms -
so ive created user control looks this
it has labels , picturebox on it. want use control inside listbox or listview using user control representation inside list. can add items listbox as:
listbox1.items.add(usercontrol1);
and before using listbox as:
private void ownerlist_drawitem(object sender, drawitemeventargs e) { // item's journeypackage drawn. listbox listbox = sender listbox; vehicle vehicle = (vehicle)listbox.items[e.index]; e.drawbackground(); //call customdraw method journeypackage class. vehicle.drawitemresume(e.graphics, e.bounds, this.font); }
but hard task have use graphics class draw.
so decided create user control , make listbox or listview of them, , able see list of image 1 post. using property drawmode listbox ownerdrawvariable im not sure if solution.
you can use control
Comments
Post a Comment