TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sakthis
NA
50
18.6k
Error in Paging C#?
Oct 28 2013 6:32 AM
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);
}
}
Reply
Answers (
7
)
saving images to picturebox
Arrays & Enum