Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ListViewSubItem

ListViewSubItem

Scheduled Pinned Locked Moved C#
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Werdna
    wrote on last edited by
    #1

    How can I retrieve ListViewSubItem's bounding rectangle? ListViewItem has GetBounds, but I need bounds of specific subitem. Thanks.

    H 1 Reply Last reply
    0
    • W Werdna

      How can I retrieve ListViewSubItem's bounding rectangle? ListViewItem has GetBounds, but I need bounds of specific subitem. Thanks.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Adjust the rectangle based on the running sum of the column widths until that column. It's either that or going to the trouble of P/Invoking the SendMessage API and calling SendMessage with LVM_GETSUBITEMRECT. You'll also have to define the RECT structure. The System.Drawing.Rectangle is not an appropriate substitute. If you do it this way, you'll have little to no chance of being able to port your code to other platforms. The first way isn't hard and would work just fine.

      Microsoft MVP, Visual C# My Articles

      W 1 Reply Last reply
      0
      • H Heath Stewart

        Adjust the rectangle based on the running sum of the column widths until that column. It's either that or going to the trouble of P/Invoking the SendMessage API and calling SendMessage with LVM_GETSUBITEMRECT. You'll also have to define the RECT structure. The System.Drawing.Rectangle is not an appropriate substitute. If you do it this way, you'll have little to no chance of being able to port your code to other platforms. The first way isn't hard and would work just fine.

        Microsoft MVP, Visual C# My Articles

        W Offline
        W Offline
        Werdna
        wrote on last edited by
        #3

        I was already looking at the first method of doing it. I just thought that maybe there is some .net method somewhere that would give me that. Thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups