ListView-style column headers?

  • Thread starter Thread starter Danny Tuppeny
  • Start date Start date
D

Danny Tuppeny

Hi all,

I need to build a Treeview/Listview control (none of those on codeproject do
quite what I need!), and was considering using one of the existing controls
as a starting point, though now I'm not so sure, and considering writing
from scratch. If I decided to do this, is there any way to draw column
headers like in the ListView (with the orange strip on mouseover etc.)
easily? I don't want ot just copy them, because I'm sure you can change
colours etc. in Windows themes, so I'd just like Windows to handle them. Is
this possible?

Thanks,
 
Extending the standard ListView or TreeView controls is almost
certainly not going to give you the flexibility you require. So
writing from scratch (or modifying a CodeProject component) is probably
the right approach. You can handle XP theme style column header
painting by using the UxTheme DLL API via DllImport. There are some
articles on CodeProject on how to do this.

Writing a Treeview/Listview control from scratch is not a trivial task.
You might want to consider some of the commerical components
available. Infralution has a combined Tree/ListView called VirtualTree
that has a lot of flexibility and allows you to modify just about any
aspect of its behaviour and/or appearance through inheritance. You can
download an evaluation copy at:

www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution
 
Grant Frisken said:
Extending the standard ListView or TreeView controls is almost
certainly not going to give you the flexibility you require. So
writing from scratch (or modifying a CodeProject component) is probably
the right approach. You can handle XP theme style column header
painting by using the UxTheme DLL API via DllImport. There are some
articles on CodeProject on how to do this.

Does DllImport mean unmanaged code, and therefore not possible for low-trust
ClickOnce apps? :(

Writing a Treeview/Listview control from scratch is not a trivial task.
You might want to consider some of the commerical components
available. Infralution has a combined Tree/ListView called VirtualTree
that has a lot of flexibility and allows you to modify just about any
aspect of its behaviour and/or appearance through inheritance. You can
download an evaluation copy at:

www.infralution.com/virtualtree.html

I wrote a treeview to do exactly what I want about a year ago in .net1.1
(though I hadn't finished the sorting). I can't find the source, and think
my programming's come on a lot since then, so I think I should be able to do
something :)

The reason I don't want to use a 3rd party control (I use DevExpress's
XtraTreeList at work, and it's great) is to keep the deployment light and
simple. The main goal of my app is to test some stuff in .net2, and one is
ClickOnce and delivering updates in the background etc. :-)
 

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

Back
Top