473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ListView-style column headers?

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,

Nov 17 '05 #1
3 6295
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

Nov 17 '05 #2
"Grant Frisken" <gr***@infralution.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
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. :-)
Nov 17 '05 #3
>
Does DllImport mean unmanaged code, and therefore not possible for low-trust
ClickOnce apps? :(

That might well be the case you'd want to do some testing.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
2
by: Ben H | last post by:
Hello all I'm using a listview in my app but I want to scroll the listview programatically as I hate the look of the standard scrollbar. So, the listview is scrolled programatically using...
4
by: firefox | last post by:
Hola Foro!, tengo una rutina que permite agregar varios elementos o items de una sola vez en un ListView. Lo que sucede es que en el momento que se añaden los items al ListView se pone todo blanco,...
0
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, In my application I need to periodically remove all current items from a ListView and add a new set into it. The following abbreviated code contains the basic idea: private void...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.