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
momo akhouri
NA
2
3.8k
C# comparing user input to random image??
Sep 8 2012 9:41 AM
Hey everyone,
I've been stuck on this for a while now and I am not sure on what to do, so help would be great!
I have created an application that displays random images in a picturebox when a button is clicked. I have done this by creating an array of images, and using the random class.
I also have a textbox for user input, so that when a random image appears (flag of america), the user should be able to guess what flag it is, and type his/her answer into the textbox.
How would I make this comparison? A little guidance would be great:)
My code so far:
public void button1_Click(object sender, EventArgs e)
{
//Array of images
Image[] images = new Image[3];
images[0] = Image.FromFile(@"C:\Users\Momo\Desktop\f… 1\india.png");
images[1] = Image.FromFile(@"C:\Users\Momo\Desktop\f… 1\australia.png");
images[2] = Image.FromFile(@"C:\Users\Momo\Desktop\f… 1\america.png");
int number = (r.Next(0, images.Length));
pictureBox1.Image = images[number];
Thank you very much:)
Reply
Answers (
1
)
how to use checkbox in datagrid using asp.net with csharp code
Use the OpenOffice.org editor in C#