<p>There doesn't seem to be a way to change the padding (or row height) for all rows in a .NET ListView. Does anybody have an elegant hack-around?</p>

[{'answer_id': 57975, 'author': 'Joel Lucsy', 'author_id': 645, 'author_profile': 'https://Stackoverflow.com/users/645', 'pm_score': 3, 'selected': False, 'text': '<p>A workaround is to use an ImageList that is as tall as you want the items to be. Just fill a blank image with the background color. You can even make the image 1 wide so as to not take much space horizontally.</p>\n'}, {'answer_id': 13072438, 'author': 'Quinn Johns', 'author_id': 1539718, 'author_profile': 'https://Stackoverflow.com/users/1539718', 'pm_score': 4, 'selected': False, 'text': '<p>I know this post is fairly old, however, if you never found the best option, I\'ve got a <a href="http://qdevblog.blogspot.co.uk/2011/11/c-listview-item-spacing.html">blog post</a> that may help, it involves utilizing LVM_SETICONSPACING. </p>\n\n<p><strong>According to my blog,</strong></p>\n\n<p>Initially, you\'ll need to add:</p>\n\n<pre><code>using System.Runtime.InteropServices;\n</code></pre>\n\n<p>Next, you\'ll need to import the DLL, so that you can utilize SendMessage, to modify the ListView parameters.</p>\n\n<pre><code>[DllImport("user32.dll")]\npublic static extern int SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);\n</code></pre>\n\n<p>Once that is complete, create the following two functions:</p>\n\n<pre><code>public int MakeLong(short lowPart, short highPart)\n{\n    return (int)(((ushort)lowPart) | (uint)(highPart &lt;&lt; 16));\n}\n\npublic void ListViewItem_SetSpacing(ListView listview, short leftPadding, short topPadding) \n{     \n    const int LVM_FIRST = 0x1000;     \n    const int LVM_SETICONSPACING = LVM_FIRST + 53;     \n    SendMessage(listview.Handle, LVM_SETICONSPACING, IntPtr.Zero, (IntPtr)MakeLong(leftPadding, topPadding));      \n} \n</code></pre>\n\n<p>Then to use the function, just pass in your ListView, and set the values. In the example, 64 pixels is the image width, and 32 pixels is my horizontal spacing/padding, 100 pixels is the image height, and 16 pixels is my vertical spacing/padding, and both parameters require a minimum of 4 pixels.</p>\n\n<pre><code>ListViewItem_SetSpacing(this.listView1, 64 + 32, 100 + 16);\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/57849', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']