I struct in Paging while i press button Last it cant work i am sure it too small error..
Can anyone..
int imageNum = 0;
int fl = 0;
ArrayList al = new ArrayList();
private void btnFirst_Click(object sender, EventArgs e)
{
try
{
if (imageNum + 1 > 0 )
{
pictureBox1.Image = Image.FromFile(al[imageNum].ToString());
imageNum = 0;
}
else
{
MessageBox.Show("No more records available");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnPre_Click(object sender, EventArgs e)
{
try
{
if (imageNum - 1 >= 0)
{
pictureBox1.Image = Image.FromFile(al[imageNum - 1].ToString());
imageNum = imageNum - 1;
}
else
{
MessageBox.Show("No more records available");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnNext_Click(object sender, EventArgs e)
{
try
{
if (imageNum + 1 < fl)
{
pictureBox1.Image = Image.FromFile(al[imageNum + 1].ToString());
imageNum = imageNum + 1;
}
else
{
MessageBox.Show("No more records available");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnLast_Click(object sender, EventArgs e)
{
try
{
if (imageNum - 1 > 0)
{
pictureBox1.Image = Image.FromFile(al[imageNum-1].ToString());
imageNum = imageNum-0;
}
else
{
MessageBox.Show("No more records available");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}