473,323 Members | 1,570 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,323 software developers and data experts.

Different font in separate listView columns

Is it possible to have a different font in individual listView columns?
When I do something like:

ListViewItem lsi;
....
lsi.SubItems[0].Font = new Font (lsi.SubItems[0].Font,
lsi.Font.SubItems[0].Style | FontStyle.Bold);

The entire line (all columns) of the list appears in bold. I just want the
first item to be bold.

Thank you,
Robert
Nov 16 '05 #1
3 6974
Hello Robert,

Just to be safe - try to carry out the same procedure on any other index
than 0. If this fails, I'm afraid you'll have to resort to custom drawing to
achieve that.
I've reviewed the LVM_SETITEM message documentation, but even this seems to
not allow setting a font for a particular item.

"Robert Misiak" <ch***********@yahoo-cut.this.part.out-.com> wrote in
message news:XC*************@newsread2.news.pas.earthlink. net...
Is it possible to have a different font in individual listView columns?
When I do something like:

ListViewItem lsi;
...
lsi.SubItems[0].Font = new Font (lsi.SubItems[0].Font,
lsi.Font.SubItems[0].Style | FontStyle.Bold);

The entire line (all columns) of the list appears in bold. I just want the first item to be bold.

Thank you,
Robert


Nov 16 '05 #2
Robert Misiak wrote:
Is it possible to have a different font in individual listView columns?
When I do something like:

ListViewItem lsi;
...
lsi.SubItems[0].Font = new Font (lsi.SubItems[0].Font,
lsi.Font.SubItems[0].Style | FontStyle.Bold);

The entire line (all columns) of the list appears in bold. I just want the
first item to be bold.


Hi Robert,

you have to set the ListViewItem.UseItemStyleForSubItems property to false.

If you later change the appearance of the ListViewItem it will
over-write the appearance of the ListViewSubItem permanently. Plan ahead.

Cheers

Arne Janning
Nov 16 '05 #3
"Arne Janning" <sp*****************@msn.com> wrote in message
news:uk**************@TK2MSFTNGP09.phx.gbl...
Robert Misiak wrote:
Is it possible to have a different font in individual listView columns?
When I do something like:

ListViewItem lsi;
...
lsi.SubItems[0].Font = new Font (lsi.SubItems[0].Font,
lsi.Font.SubItems[0].Style | FontStyle.Bold);

The entire line (all columns) of the list appears in bold. I just want the first item to be bold.
Hi Robert,

you have to set the ListViewItem.UseItemStyleForSubItems property to

false.
If you later change the appearance of the ListViewItem it will
over-write the appearance of the ListViewSubItem permanently. Plan ahead.

Cheers

Arne Janning


Thanks, Arne! It works.

Robert
Nov 16 '05 #4

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

Similar topics

0
by: Nuke van Dyke | last post by:
Hi, I'm searching for an advanced TextArea GUI Component. Should be written in Swing. Possible open source!! It should handle - stylings like underline, bold, italic, colors - different...
2
by: John | last post by:
Now and again I like to start a sentence with a large capital, maybe in a different font. This upsets the line spacing and I've failed to find any css that will effectively crop the capital letter...
4
by: Glen K | last post by:
The following works in Firefox buy not in Internet Explorer: <select> <option> option1 </option> <option style="font-style: bold"> option2 </option> </select> Are there any workarounds to...
0
by: Samuel R. Neff | last post by:
I'm having a index problem with ListView SubItems. If I add multiple columns to the listview and then add items with associated subitems, the ListView displays fine. Then if I delete a column via...
1
by: Scott Kay | last post by:
Hi, When I use the AllowColumnReorder in the ListView Control, this allows the user to reorder columns by dragging them around. Any items added to the control after the user has reordered them...
3
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the...
5
by: billuy | last post by:
Is there a way to sort by a specified column in a listview? I'd like my users to be able to click on the column heading and have the listview sort by that column. Thanks, Billyb
0
by: --== Alain ==-- | last post by:
Hi, i would like to custom my ListView control by making a particular property editor for ListView.Columns property. Basically, i want to allow use to choose among several types of columns...
4
by: CyberSoftHari | last post by:
I am suppose to show a product name in english and another language as well. EX: PRODUCT NAME | PRODUCT NAME (Tamil) | PRICE | HOW do i set different font column in any list type controls. Any...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: 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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.