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 TrivediPosted Oct 29, 2013, 4:06 AM
sorry for Inconvenient
SakthisPosted Oct 29, 2013, 4:02 AM
But my header file is clear here :
Jignesh TrivediPosted Oct 29, 2013, 3:55 AM
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);
}
}
SakthisPosted Oct 29, 2013, 3:48 AM
I didn't get success it shows error like "No more records available" when i click the button Last..
Jignesh TrivediPosted Oct 29, 2013, 12:35 AM
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.....
SakthisPosted Oct 28, 2013, 8:18 AM
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..
Jaganathan BantheswaranPosted Oct 28, 2013, 7:12 AM