473,698 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listview column headers

JL
Is it possible and if so, how, to change the color (and/or font) of a
listveiw's column headers at runtime and individually?

TIA,
John
Nov 21 '05 #1
3 4173
No, the ColumnHeader class of the .NET Framework lacks those properties, so
you would need to use custom drawing and the Win32 API. Notice that there is
a Column Header control on its own that the listview uses internally, and
that you can get its window handle sending the LVM_GETHEADER message to the
listview:

http://msdn.microsoft.com/library/de...der/header.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"JL" <jo**@marymonte .com> escribió en el mensaje
news:bk******** *************** *********@4ax.c om...
Is it possible and if so, how, to change the color (and/or font) of a
listveiw's column headers at runtime and individually?

TIA,
John

Nov 21 '05 #2
"JL" <jo**@marymonte .com> schrieb:
Is it possible and if so, how, to change the color (and/or font) of a
listveiw's column headers at runtime and individually?


<URL:http://www.codeproject .com/cs/miscctrl/customheader.as p>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3
JL
Thank you Carlos and Herfried. I was afraid it was not possible. Seems
very short sited of MS to leave out those important properties. But,
oh well...

John

On Tue, 20 Sep 2005 16:09:52 -0700, JL <jo**@marymonte .com> wrote:
Is it possible and if so, how, to change the color (and/or font) of a
listveiw's column headers at runtime and individually?

TIA,
John


Nov 21 '05 #4

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

Similar topics

0
1370
by: Richard | last post by:
Hi. How can I detect right-click on the ListView Column Headers? The click event doesn't do it. Thank you very much, Rick
1
2359
by: Ray Mitchell | last post by:
Hello, I'm trying to create a ListView object with several labeled columns. Using the Visual Studio Toolbox I simply drag a ListView item onto my dialog box. Then I go into the Columns (Collection) property and add 3 columns. I am strictly relying on all the automatically generated code and not adding or changing any code manually. The program compiles fine but when I run it the list is there but there are no columns or column titles....
2
433
by: MFRASER | last post by:
I am trying to populate a listview and I can not see the column headers, is there a property I am forgetting to set? Here is my code // Create three items and three sets of subitems for each item. ListViewItem item1 = new ListViewItem("item1",0); // Place a check mark next to the item.
1
5629
by: Sam Martin | last post by:
hi all, anyone know how i can detect this i c#? tia sam martin
3
6325
by: Danny Tuppeny | last post by:
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...
2
5191
by: Marco | last post by:
Is there a way to get the text in a column header to wrap to multiple lines? I'm using vb.net 2003.
0
1170
by: erik.alsmyr | last post by:
When setting the Scrollable property of a listview and resizeing it the headers will be painted wrongly. This defect is documented in MSDN as: In versions of the .NET Framework prior to version 2.0, the column headers were not painted correctly when setting this property to false and resizing the control to make it larger. To work around this issue, set this property to true in a ResizeBegin event handler and set it back to false in a...
1
6332
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Short of writing a custom version of the ListView control, is there a way to force the column headers to contain multiple lines. The problem is that the actual values of the items in each column only need 2 or 3 characters while the description of them in the column title takes many. Thus, my columns end up being needlessly wide. Thanks, Ray
1
1493
by: =?Utf-8?B?LnBhdWwu?= | last post by:
how do i change the color of the text in the fixedrow (column headers) of a listview? thanks
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9166
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.