Advertisement

01.12.2007 at 12:44PM PST, ID: 22121012
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

ListViewColumn Headers and Owner Draw

Asked by carpbyte in Microsoft Visual Basic.Net

Tags:

I'm trying to use OwnerDraw to allow me to add masks to icons in a list view.

I've got the icon portion working but I can't figure out how to draw the columnheaders. I'm also using groups, but the groups are drawing text fine, just no column headers.

One other issue is that occasionally the subitems will draw flakey, almost like the text was wrapping...

???

Thanks.

    Private Sub lvAll_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawListViewItemEventArgs) Handles lvAll.DrawItem
        Dim sf As New StringFormat
        sf.LineAlignment = StringAlignment.Center

        Try
            Dim x As Integer
            Dim img As Image
            img = iml.Images(e.Item.ImageKey)
            e.Graphics.DrawImage(img, e.Item.Bounds.Left, e.Item.Bounds.Top)
            img = iml.Images("checked") 'Add check mark
            e.Graphics.DrawImage(img, e.Item.Bounds.Left, e.Item.Bounds.Top)
            e.Graphics.DrawString(e.Item.Text, tvMulti.Font, Brushes.Black, New RectangleF(img.Width, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height), sf)
            For x = 1 To e.Item.SubItems.Count - 1
                e.Graphics.DrawString(e.Item.SubItems(x).Text, me.Font, Brushes.Black, New RectangleF(e.Item.SubItems(x).Bounds.X, e.Item.SubItems(x).Bounds.Y, e.Item.SubItems(x).Bounds.Width, e.Item.SubItems(x).Bounds.Height), sf)
            Next
        Catch ex As Exception

        End Try
    End SubStart Free Trial
 
Loading Advertisement...
 
[+][-]01.13.2007 at 09:07PM PST, ID: 18310883

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: draw
Sign Up Now!
Solution Provided By: NickGeorghiou
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20081112-EE-VQP-44 - Hierarchy