![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Dec 2006
Posts: 50
Rep Power: 2
![]() |
Button click on PictureBox
I have made a program in the .NET compact framework for a windows mobile PC Pocket PC. I have 6 Bitmap images in which I have loaded into 6 picturebox's. I am wondering if it is possible to process a button click on a picturebox. I'm reading a .NET compact framework book and it says that picturebox's cannot accept button clicks and that you must use the Override OnPaint method or something. I tried doing....
private void pictureBox1_Click(object sender, EventArgs e)
{
if (pictureBox1.Click = true)
{
//do stuff
}but I got an error saying that "The event 'System.Windows.Forms.Control.Click' can only appear on the left hand side of += or -=". Is there a way to do this?? |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Dec 2006
Posts: 50
Rep Power: 2
![]() |
Re: Button click on PictureBox
Sorry...I meant...if(pictureBox1.Click == true)
typoo |
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4
![]() |
Re: Button click on PictureBox
If you're using visual studio, switch to Designer and select the picture box. Press Spacebar for properties and click the small 'events' button on top (yellow thunder icon). This will give you the list of all possible events for the selected controller. find the mouseclick and double click the empty drop down on the right. This should create a method for handling the mouse click.
|
|
|
|
|
|
#4 |
|
Professional Programmer
|
Re: Button click on PictureBox
Am I missing something ?
csharp Syntax (Toggle Plain Text)
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#5 | |
|
Expert Programmer
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4
![]() |
Re: Button click on PictureBox
Quote:
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vista Elements Button | Alias | Existing Project Development | 2 | Nov 9th, 2007 6:25 PM |
| Applet / Button problem. | TCStyle | Java | 1 | Apr 29th, 2007 12:10 PM |
| Button click | Heba | PHP | 1 | Mar 1st, 2006 7:08 AM |
| IE and dynamic button creation | MegaArcon | JavaScript and Client-Side Browser Scripting | 5 | Dec 6th, 2005 9:31 AM |
| Automate button click from C# | bobfox | C# | 2 | Sep 8th, 2005 10:55 AM |