I have a listview with some rows, and all have a progressBar.
Adjusting column width works fine (as by design), however as it easily moves text within rows, it does NOT move the progressbar, resize it or even move it around.. without writing this:
private void fileList_ColumnWidthChanged(object sender, ColumnWidthChangedEventArgs e)
{
foreach (CustomProgressBar p in fileList.Controls.OfType<CustomProgressBar>().ToList())
{
if (e.ColumnIndex == 0)
{
p.Width = fileList.Columns[3].Width;
p.Left = fileList.Columns[e.ColumnIndex].Width + 400;
}
else if (e.ColumnIndex == 1)
{
p.Width = fileList.Columns[3].Width;
p.Left = fileList.Columns[e.ColumnIndex].Width + 227;
}
}
}
I couldn't figure it out, so that was my only solution.. which "partially works".
General column resizing (no particular order)

Is there something I am missing about automatically aligning items correctly according to the column position or width?
The code I wrote has zero effect after the 2nd column, as I can not confirm if it is working correctly for column1/column2 to begin with. So I dont see a point implementing the rest of it, if its set to fail anyway.
Any help is appreciated.
.NET Framework 4.8 / WinForms
--
NOTE: ProgressBar responds to all typical properties as would a regular progressBar. The difference is just the overlay shade and color. Nothing more.



