RE: displaying list (in a pretty way)
From: Martin Platt (MartinPlatt_at_discussions.microsoft.com)
Date: 07/08/04
- Next message: Duncan Mole: "P/Invoke structure question"
- Previous message: Alexander Muylaert: "Graphical engine"
- In reply to: Piotrek Stachowicz: "displaying list (in a pretty way)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Jul 2004 23:50:01 -0700
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.
"Piotrek Stachowicz" wrote:
> 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
>
>
>
- Next message: Duncan Mole: "P/Invoke structure question"
- Previous message: Alexander Muylaert: "Graphical engine"
- In reply to: Piotrek Stachowicz: "displaying list (in a pretty way)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|