ListViewSubItem
-
How can I retrieve ListViewSubItem's bounding rectangle? ListViewItem has GetBounds, but I need bounds of specific subitem. Thanks.
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 callingSendMessage
withLVM_GETSUBITEMRECT
. You'll also have to define theRECT
structure. TheSystem.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
-
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 callingSendMessage
withLVM_GETSUBITEMRECT
. You'll also have to define theRECT
structure. TheSystem.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