i have a database from which i count the total no of entries and create a loop for the count and for each count i need to show a piturebox with an image 2.jpg i having problems. Please help
Loading
i have a database from which i count the total no of entries and create a loop for the count and for each count i need to show a piturebox with an image 2.jpg i having problems. Please help
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jan MontanoPosted Jun 25, 2008, 1:51 AM
private void button5_Click(object sender, EventArgs e)
{
PictureBox[] a = new PictureBox[5];
int x = 5;
int y = 5;
for (int i=0; i<5; i++)
{
y += 60;
a[i] = new PictureBox();
a[i].Image = Image.FromFile(@"C:\Documents and Settings\Default User\My Documents\My Pictures\sample.jpg");
a[i].Location = new Point(x, y);
this.Controls.Add(a[i]);
}
}
utsav rathourPosted Jun 24, 2008, 10:50 PM
Well the list count is 5 from my table and want to use array.
something like.
picturebox [] a= new picturebox[20];{
for(i=0;i
a[i].image = image.fromfile(application.startupath+"\\a.jpg");
a[i].location = "position";
}
-------------
But it is not working what do i do?
Bechir BejaouiPosted Jun 24, 2008, 5:25 PM
imageList.images[index]