473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

In PictureBox click event and need to know which button was pressed

I'm in the PictureBox click event and I need to know which button was
pressed.

I'm sure I once saw a property in Form or SystemInformation or someplace
that system wide that enabled one to determine which button is down.

But now that I need it I can't find it.

Maybe it was in Window API.

Private Sub PictureBoxPic_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles PictureBoxPic.Click

End Sub

Can anyone help?

Thanks
Feb 22 '07 #1
3 1579
I just used QuickWatch to look at e and find it is really MouseEventsArgs
although the IDE creates a EventsArgs.

Can someone comment on that??

" active" <ac**********@a-znet.comwrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
I'm in the PictureBox click event and I need to know which button was
pressed.

I'm sure I once saw a property in Form or SystemInformation or someplace
that system wide that enabled one to determine which button is down.

But now that I need it I can't find it.

Maybe it was in Window API.

Private Sub PictureBoxPic_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles PictureBoxPic.Click

End Sub

Can anyone help?

Thanks


Feb 22 '07 #2
" active" <ac**********@a-znet.comschrieb:
I'm in the PictureBox click event and I need to know which button was
pressed.

I'm sure I once saw a property in Form or SystemInformation or someplace
that system wide that enabled one to determine which button is down.
\\\
Private Sub Form1_Click( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles Me.Click
If TypeOf e Is MouseEventArgs Then
MsgBox(DirectCast(e, MouseEventArgs).Button.ToString())
End If
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Feb 22 '07 #3
perfect
thanks

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:eO**************@TK2MSFTNGP03.phx.gbl...
>" active" <ac**********@a-znet.comschrieb:
>I'm in the PictureBox click event and I need to know which button was
pressed.

I'm sure I once saw a property in Form or SystemInformation or someplace
that system wide that enabled one to determine which button is down.

\\\
Private Sub Form1_Click( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles Me.Click
If TypeOf e Is MouseEventArgs Then
MsgBox(DirectCast(e, MouseEventArgs).Button.ToString())
End If
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Feb 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MJW | last post by:
Is there a way for me to know if or which command button was just clicked that triggers the LostFocus event for the current control on a Form? I have a form that has many types of users who each...
1
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the...
2
by: kalp suth via DotNetMonster.com | last post by:
I want to create arrows using lines on a picture in the picture box. On clicking the button "btnShowAll", the image is loaded and the lines drawn. "RGSShowAll()" calls "DrawObjs()" which does the...
2
by: Mattbooty | last post by:
Hello, Not sure if anyone else has seen this bug, but I have a form where the entire form is covered with a picturebox. The picturebox has a mouseup event. I also have an open file dialog for...
5
by: Jazz | last post by:
Hello, I have an asp button control(called buttonA), and in the Form_Load event I want to know if the postback is due to the click of ButtonA. Which method should I use to achieve this? ...
3
by: Robert W. | last post by:
I'm new to ASP.net programming so excuse my ignorance if the following question seems overly simplistic. I've created a simple Login form with 3 primary WebControls: - A TextBox for the Username...
5
by: toby | last post by:
Hi there, Is it possible to create an array of picturebox controls during run-time. I wish to create a new image/picturebox everytime a user clicks the button on a form, and they need to be...
2
by: Max2006 | last post by:
Hi, I have a simple form with a button on it. After a button click postback, anytime user press F5 (browser page refresh), the button's OnClick event handler is called again without the button...
1
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.