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
tan shen
NA
11
1.9k
I want to make a simple picture slideshow from the stated fo
Nov 1 2017 10:15 PM
I want to make a simple picture slideshow from the stated folder. The label show the full location detail of the image, how can the label show the picture name only?
int
counter = 0;
private
void
button1_Click(
object
sender, EventArgs e)
{
timer1.Start();
//start the slideshow
}
private
void
timer1_Tick(
object
sender, EventArgs e)
{
counter++;
string
path = @
"C:\Users\Tan Wei Shen\Desktop\FYP\Animal"
;
//directory of the picture
string
[] filePaths = Directory.GetFiles(path,
"*.jpg "
);
if
(counter > filePaths.Length - 1)
{
counter = 0;
//reset the picture
}
pictureBox1.Image = Image.FromFile(filePaths[counter]);
//show image
label1.Text = filePaths[counter];
//show name of the image
}
Reply
Answers (
3
)
Both DataSource and DataSourceID are defined on 'MedicalSche
An existing connection was forcibly closed by the remot host