?
Solved

listview  "Column name"  Font Change in C# windows form

Posted on 2007-11-14
2
Medium Priority
?
3,542 Views
Last Modified: 2013-12-17
i want the listview colmn name to be of font 8 and i want the rest of the rows to be of 12 font can any one can help me abt this
0
Comment
Question by:kranthi4uonly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 22

Expert Comment

by:RedKelvin
ID: 20285124
Hi there,
I think you will need to start with this,
http://www.codeproject.com/cs/miscctrl/customheader.asp
0
 
LVL 22

Accepted Solution

by:
RedKelvin earned 2000 total points
ID: 20285185
Ok, sorry disregard that,

you need to set ownerDraw for your listview to true, and subscribe to the DrawColumnHeader event

            this.listView1.OwnerDraw = true;
            this.listView1.DrawColumnHeader += new DrawListViewColumnHeaderEventHandler(listView1_DrawColumnHeader);

and define the event

        void listView1_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
        {
            using (StringFormat sf = new StringFormat())
            {
                // Draw the header text.
                using (Font headerFont = new Font("Helvetica", 8, FontStyle.Bold))
                {
                    e.Graphics.DrawString(e.Header.Text, headerFont,
                        Brushes.Black, e.Bounds, sf);
                }
            }
        }

http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.drawcolumnheader.aspx
0

Featured Post

Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question