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);
}
}

Jignesh TrivediRank #16 · 50.3K reputationPosted Oct 29, 2013, 12:06 AM EDT
sorry for Inconvenient
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 28, 2013, 3:12 AM EDT
Sakthis50 reputationPosted Oct 28, 2013, 4:18 AM EDT
Actually btn Previous, First, Next works fine but i am not sucess result with btn last, i have few record in that once i click Previous, First, Next works nice but click last it cant go last record..
Guide me..
Jignesh TrivediRank #16 · 50.3K reputationPosted Oct 28, 2013, 8:35 PM EDT
in button last click event why you writting "imageNum = imageNum-0; "
i think it shoud be imageNum = imageNum-1;
try it and get back to us if your problem is not resolved.....
Sakthis50 reputationPosted Oct 28, 2013, 11:48 PM EDT
I didn't get success it shows error like "No more records available" when i click the button Last..
Jignesh TrivediRank #16 · 50.3K reputationPosted Oct 28, 2013, 11:55 PM EDT
sorry you are click on last button
try....
private void btnLast_Click(object sender, EventArgs e)
{
try
{
imageNum = al.Length;
if (imageNum - 1 > 0)
{
pictureBox1.Image = Image.FromFile(al[imageNum-1].ToString());
}
else
{
MessageBox.Show("No more records available");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Sakthis50 reputationPosted Oct 29, 2013, 12:02 AM EDT
But my header file is clear here :