473,804 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SystemInformati on 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_C lick(ByVal sender As Object, ByVal e As
System.EventArg s) Handles PictureBoxPic.C lick

End Sub

Can anyone help?

Thanks
Feb 22 '07 #1
3 1593
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******** **********@TK2M SFTNGP05.phx.gb l...
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 SystemInformati on 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_C lick(ByVal sender As Object, ByVal e As
System.EventArg s) Handles PictureBoxPic.C lick

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 SystemInformati on 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(DirectCa st(e, MouseEventArgs) .Button.ToStrin g())
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******** ******@TK2MSFTN GP03.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 SystemInformati on 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(DirectCa st(e, MouseEventArgs) .Button.ToStrin g())
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
8953
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 have their own set of fields they can change. Therefore I use setfocus property in the lostfocus event for some of the users to get from one control to another. Since I am "directing traffic" with setfocus, the users are unable to use the...
1
8170
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 first time the control is dynamically loaded, everything works fine. After that, if the control is loaded again from the page button event handler, the user controls events fail to fire on the first click NOTE: I (believe I) am rebuilding all...
2
10342
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 actual drawing work. But after displaying all the arrows in a flick, the arrows disappers. I have debugged and came to know that the "Paint" event of the picturebox is refreshing the image, so the work done on the CreateGraphics created object is...
2
6159
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 loading images into the picturebox. If you double click the file you want to open in the open file dialog, it somehow interperets one of the clicks as a mouseup on the picturebox and fires the mouseup event for the picturebox. How can I get...
5
1355
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? Thanks, Jazz
3
4295
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 - A TextBox for the Password - A Button labelled "Submit" If the user enters a correct username/password combination then he's taken to another page. But if either or both are incorrect then a simple message
5
4567
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 objects so that the user can move/drag them around. The only examples I can find dont work as I am using VB Express (2005?)
2
5010
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 actually be pressed! Is this a bug in ASP.NET? Is there any technique to prevent that? I know that a Response.Redirect to the same page solves the issue, however because of some requirements; it is not an option for me.
1
7030
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 page has multiple button such login page with a search function somewhere around, then it's not respond properly. I have attached a brief example of two text boxes and two button. When ever a key is press on textbox one, I want to trigger...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.