Click to See Complete Forum and Search --> : Progressbar inside of listview?


Spasm
November 18th, 2008, 03:46 AM
Is there any way to get like a listview of controls? I need something that looks like a listview that can hold an image, text, and a progressbar.

HanneSThEGreaT
November 18th, 2008, 05:16 AM
If you want a ProgressBar inside one of your LV Columns, you could do something like this :
public System.Windows.Forms.ProgressBar LvAddProgB(ref System.Windows.Forms.ListView LV, int LVII, int LVColI)
{
Rectangle SizeR = default(Rectangle);
//Size of LV Items
System.Windows.Forms.ProgressBar ProgBar = new System.Windows.Forms.ProgressBar();
//New Prog Bar

SizeR = LV.Items(LVII).Bounds();
//Get Size
SizeR.Width = LV.Columns(LVColI).Width;
//Get Width
//If No Cols
if (LVColI > 0) {
SizeR.X = SizeR.X + LV.Columns(LVColI - 1).Width;
//
}
ProgBar.Parent = LV;
//Put Prog bar In LV
ProgBar.SetBounds(SizeR.X, SizeR.Y, SizeR.Width, SizeR.Height);
//Specify Locations etc.
ProgBar.Visible = true;
//Show PB

return ProgBar;
}

Usage :

LvAddProgB(ListView1, 1, 0);
//Usage Anywhere in an event


Add a couple of LV Items, and Columns, and experiment with this code.

I sincerely hope my info was useful :)