RE: displaying list (in a pretty way)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Martin Platt (MartinPlatt_at_discussions.microsoft.com)
Date: 07/08/04


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
>
>
>



Relevant Pages

  • displaying list (in a pretty way)
    ... I'd like to display list of items in my form. ... background to change when mouse is hovering over the row. ... few controls, each time setting proper size and location, and proper event ... listview (datagrid seems to be harder to display data the way I want). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Bad advice from a spammer
    ... If this text is displayed, your email client cannot display ... no HTML and especially no Javascript - ... creamin yer panties before it's time to pop the champagne proper." ...
    (alt.2600)
  • Re: Is my monitor shot or is it software related?
    ... The laptop display is an LCD, ... is set to the proper "native" resolution for that display. ... external monitor indicates that the software and internal ...
    (microsoft.public.windowsxp.hardware)
  • Re: Oregano group. Was: Oragano 1 not fetching
    ... sites do not display properly, ... overlapping other chunks of text or graphics, ... owner to write back to me telling me to use a proper ... supplied by Google to help them index the page better. ...
    (comp.sys.acorn.apps)
  • Re: Why does Word display "within margin" page width and lenght as 44.
    ... Word does not display the proper width or length ... > I am now also contending with the top and bottom margin of a page in ... > I've tried uninstalling and reinstalling Office. ...
    (microsoft.public.word.docmanagement)