hi, is there a working vb.net way to resize last column of listview to fill remainder of listview that anyone knows of?
Private Sub ListView1_Resize(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ListView1.Resize
ListViewHeader2.Width = ListView1.Width - ListViewHeader2.Width - 27
the problem comes that when there are more items in the listview than those that are visible,
then because vertical scrollbar is added, a horizontal scrollbar is added as well, thus the value of 27 doesnt work
the autoresize trick (www.codeproject.com/cs/miscctrl/AutoResize.asp
wont work either because it's in C and it uses send keys
this is prob the best i've seen but its in c# , could anyone possible help me do this in vb?
To implement the the auto-size of the last column, subclass the ListView control, and override the WndProc method.
protected override void WndProc( ref Message message )
const int WM_PAINT = 0xf ;
// if the control is in details view mode and columns
// have been added, then intercept the WM_PAINT message
// and reset the last column width to fill the list view
switch ( message.Msg )
if ( this.View == View.Details && this.Columns.Count > 0 )
Count - 1].Width = -2 ;
// pass messages on to the base control for processing
base.WndProc( ref message ) ;