Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Reply
How to load a different image to a picture box on click event
Prasadi
11 years ago
1.9k
Reply
Hi,
Im developing a game using c sharp. For that i want to know how to change the default picture box image in to another image on click event. When the user click on the picture box should display another image. Then it should disable the picture box so no body else can click on it again.
this is the code i have done
private void Game_Logic(int tossnum)
{
bool flag = false;
if (tossnum != 0)
{
if (this.pictureBox1.Click == true)
{
pictureBox1.Image = new Bitmap("C:\\Users\\pchathurani\\Documents\\Visual studio My projects\\Game\\Game\\images\\player_one.png");
flag = true;
}
}
}
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Role manager in Asp.Net
I want to study the crystal report?