Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is a panel containing multiple images with error images(erroricon).I have to print all the images at once by removing the error icon image using c#
Posted
Comments
abdul subhan mohammed 25-May-15 6:28am    
Plz post your code

1 solution

This is my code .Its working for one error icon but not for more error icons...

private Image GetNextImage()
{

//if number of images are 1 on flowlayoutpanel
if (flowLayoutPanel2.Controls.Count == 1)
{
PictureBox pictureBox = (PictureBox)flowLayoutPanel2.Controls[flowLayoutPanel2.Controls.Count - imagesToPrintCount];
imagesToPrintCount--;
return pictureBox.Image;
}

//if the images on flowlayoutpanel are more than one,then to get images.
else
{
PictureBox pictureBox = (PictureBox)flowLayoutPanel2.Controls[(flowLayoutPanel2.Controls.Count) - (imagesToPrintCount)];
string currentoutputimage = pictureBox.Name;
if (currentoutputimage.IndexOf("nope-icon") >= 0)
{
imagesToPrintCount--;
if(imagesToPrintCount>0)
pictureBox = (PictureBox)flowLayoutPanel2.Controls[(flowLayoutPanel2.Controls.Count) - (imagesToPrintCount)];
}
imagesToPrintCount--;
return pictureBox.Image;
}
 
Share this answer
 
v3
Comments
aarif moh shaikh 5-Jun-15 2:34am    
... is it solution or Problem ??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900