displaying list (in a pretty way)

  • Thread starter Piotrek Stachowicz
  • Start date
P

Piotrek Stachowicz

Hi there,
I'd like to display list of items in my form. Each item has 3 properties
i.e.
description , picture (1 of 3 kinds), and url. I want to display it in nice
way, e.g.
every second row should have different background, additionaly I'd like the
background to change (3rd color) when mouse is hovering over the row.
Moreover I'd like to support drag 'n' drop on each item. User cannot change
anything on the list.

I have already created a form which does all these things but it isn't
very efficient. I just created a panel, and for each row of data I created a
few controls, each time setting proper size and location , and proper event
handlers (for hovering, and drag'n'drop).

I'm sure there is a way to do it better, for instance using listview or
datagrid. Data to be displayed are placed in DataTable but I'd rather use
listview (datagrid seems to be harder to display data the way I want).

If you have any suggestions/ideas , please.

Regards,
Piotrek Stachowicz
 
G

Guest

There is an easier way. You need to override the drawing of the item, and change the colour of the backgroudn, depending upon what state the control is in. There are definitely samples on the net to show you how to change the fonts and background colours of a listbox. I did something very similar, so if you really can't find anything I'll copy my code up here for you...

Cheers,

Martin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top