-
Sep 5th, 2021, 11:35 PM
#1
Thread Starter
Banned
click on PictureBox vb.net help me
hello
How can I click on the PictureBox using a button inside the form?
My project reads the phone screen and I want to assign buttons to some applications, for example, I want when I click on the button called WhatsApp, it presses in the PictureBox in the same place as the button inside the form to open the application everything is fine with me but how do I make the button click in PictureBox
Last edited by JohnMar; Sep 6th, 2021 at 01:37 AM.
-
Sep 6th, 2021, 12:57 AM
#2
Re: click on PictureBox vb.net help me
Please explain what you're actually trying to achieve, rather than how you're trying to achieve it. If you are clicking on a Button then you're clicking on a Button, not a PictureBox. What is it that you actually expect happen?
-
Sep 6th, 2021, 01:31 AM
#3
Thread Starter
Banned
Re: click on PictureBox vb.net help me
Originally Posted by jmcilhinney
Please explain what you're actually trying to achieve, rather than how you're trying to achieve it. If you are clicking on a Button then you're clicking on a Button, not a PictureBox. What is it that you actually expect happen?
My project reads the phone screen and I want to assign buttons to some applications, for example, I want when I click on the button called WhatsApp, it presses in the PictureBox in the same place as the button inside the form to open the application everything is fine with me but how do I make the button click in PictureBox
-
Sep 6th, 2021, 04:55 AM
#4
Re: click on PictureBox vb.net help me
That's not really help very much. Why do you need to "click" the PictureBox when you're already clicking the Button? Why can't you just do whatever you need to do in the Click event handler of the Button? Try providing a FULL and CLEAR explanation of the problem. Things like "My project reads the phone screen" is way too vague.
-
Sep 6th, 2021, 05:34 AM
#5
Thread Starter
Banned
Re: click on PictureBox vb.net help me
Originally Posted by jmcilhinney
That's not really help very much. Why do you need to "click" the PictureBox when you're already clicking the Button? Why can't you just do whatever you need to do in the Click event handler of the Button? Try providing a FULL and CLEAR explanation of the problem. Things like "My project reads the phone screen" is way too vague.
I explained everything to you
Is there a way to click on PictureBox using a button or an event PictureBox keydown ?
-
Sep 6th, 2021, 05:54 AM
#6
Re: click on PictureBox vb.net help me
this is strange, it looks like Herocode demand : invoke a click event somewhere on the screen on a picture via an other way (button or keyboard).
Why do you want to click on a button to invoke the picture.click event if you can click on the picture? or you cannot click on the picture because you don't have access to the picture because it is not on your own screen but somewhere else ?
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
-
Sep 6th, 2021, 01:23 PM
#7
Re: click on PictureBox vb.net help me
Originally Posted by Delaney
this is strange, it looks like Herocode demand : invoke a click event somewhere on the screen on a picture via an other way (button or keyboard).
Why do you want to click on a button to invoke the picture.click event if you can click on the picture? or you cannot click on the picture because you don't have access to the picture because it is not on your own screen but somewhere else ?
Maybe this is just an image of the phone screen, not individual images for each app. But that just a guess and why we need more information.
If for some reason you want to click a button, which then clicks an image then here https://stackoverflow.com/questions/...-a-picture-box
-
Sep 6th, 2021, 02:37 PM
#8
Re: click on PictureBox vb.net help me
But if you want to click with your vb application on a picture or icon outside the application, I think you need to create a mouse Hook to interact with the icon or you can just start the application with process.start.
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
-
Sep 6th, 2021, 04:24 PM
#9
Re: click on PictureBox vb.net help me
Originally Posted by Delaney
But if you want to click with your vb application on a picture or icon outside the application, I think you need to create a mouse Hook to interact with the icon or you can just start the application with process.start.
If it's outside the application then it's completely different. But the OP said his app reads a phone screen, I took that as importing it into the application. Because he wants to click a PictureBox inside the form. If it's not, then Process.Start seems reasonable.
-
Sep 6th, 2021, 04:38 PM
#10
Re: click on PictureBox vb.net help me
the OP said
Originally Posted by JohnMar
it presses in the PictureBox in the same place as the button inside the form to open the application everything is fine with me but how do I make the button click in PictureBox
so he wants to open an application. but not need for a button, check the area of the picture box where you click and and if it is in a zone defined with an application, open the application.
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
-
Sep 6th, 2021, 05:04 PM
#11
Re: click on PictureBox vb.net help me
Originally Posted by Delaney
the OP said
so he wants to open an application. but not need for a button, check the area of the picture box where you click and and if it is in a zone defined with an application, open the application.
Hell, I don't know. lol
The whole thing doesn't make sense.
-
Sep 6th, 2021, 07:49 PM
#12
Re: click on PictureBox vb.net help me
Originally Posted by JohnMar
I explained everything to you
No you didn't, as evidenced by the fact that at least two other people don't really know what you're on about. If you're not prepared to make the effort to provide a proper explanation then I'm not wasting any more of my time making an effort to work out how to help.
-
Sep 6th, 2021, 07:53 PM
#13
Thread Starter
Banned
Re: click on PictureBox vb.net help me
Originally Posted by jmcilhinney
No you didn't, as evidenced by the fact that at least two other people don't really know what you're on about. If you're not prepared to make the effort to provide a proper explanation then I'm not wasting any more of my time making an effort to work out how to help.
How can I determine when a key is pressed at a specific place on the screen?
For example, I want to press a specific letter on the keyboard, how do I specify the place to press, such as Location = New Point
Code:
<DllImport("user32.dll")>
Private Shared Function keybd_event(bVk As Byte, bScan As Byte, dwFlags As UInteger, dwExtraInfo As Integer) As Boolean
End Function
Const KEYEVENTF_KEYDOWN = &H0
Const KEYEVENTF_KEYUP = &H2
-
Sep 6th, 2021, 08:25 PM
#14
Re: click on PictureBox vb.net help me
Looks like HeroCode has a new account
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 6th, 2021, 09:24 PM
#15
Re: click on PictureBox vb.net help me
Originally Posted by JohnMar
How can I determine when a key is pressed at a specific place on the screen?
For example, I want to press a specific letter on the keyboard, how do I specify the place to press, such as Location = New Point
That's still nonsensical as you don't press keyboard keys at a place on the screen and it also is quite different from the original stated topic of this thread, although it is similar to the topics of some other threads that have been closed. I don't know whether there's a language issue here but you are genuinely terrible at explaining things. Maybe you're trying to say that, when the user presses a particular key, you want to simulate a mouse click at a specific point on the screen. That might make sense but it's not the topic of this thread and someone - I suspect you - has been told not to ask about that subject.
-
Sep 6th, 2021, 09:38 PM
#16
Thread Starter
Banned
Re: click on PictureBox vb.net help me
Originally Posted by jmcilhinney
That's still nonsensical as you don't press keyboard keys at a place on the screen and it also is quite different from the original stated topic of this thread, although it is similar to the topics of some other threads that have been closed. I don't know whether there's a language issue here but you are genuinely terrible at explaining things. Maybe you're trying to say that, when the user presses a particular key, you want to simulate a mouse click at a specific point on the screen. That might make sense but it's not the topic of this thread and someone - I suspect you - has been told not to ask about that subject.
You tired me mentally
-
Sep 6th, 2021, 09:57 PM
#17
Re: click on PictureBox vb.net help me
Learn how to explain your problem coherently and you can avoid that in the future. We're here because we want to help. Like others, I answer questions here regularly. When someone posts a clear explanation of a problem, I don't aggravate them for no reason. I just provide a solution to the problem. If you had provided a clear explanation of your problem then the same would have happened here. If I've tired you mentally, it's really just a taste of your own medicine. If you expect to get anything out of sites like this, you need to first acknowledge that your posts are garbage - at least three people have expressed confusion over the problem in this thread alone - and then make the effort to improve. If you insist on assuming that others are the problem and are just being mean for no reason, you're unlikely to get much of the help you want.
-
Sep 6th, 2021, 10:16 PM
#18
Thread Starter
Banned
Re: click on PictureBox vb.net help me
Originally Posted by jmcilhinney
Learn how to explain your problem coherently and you can avoid that in the future. We're here because we want to help. Like others, I answer questions here regularly. When someone posts a clear explanation of a problem, I don't aggravate them for no reason. I just provide a solution to the problem. If you had provided a clear explanation of your problem then the same would have happened here. If I've tired you mentally, it's really just a taste of your own medicine. If you expect to get anything out of sites like this, you need to first acknowledge that your posts are garbage - at least three people have expressed confusion over the problem in this thread alone - and then make the effort to improve. If you insist on assuming that others are the problem and are just being mean for no reason, you're unlikely to get much of the help you want.
I want make keymapper gaming
-
Sep 6th, 2021, 10:25 PM
#19
Re: click on PictureBox vb.net help me
Originally Posted by JohnMar
I want make keymapper gaming
That still doesn't actually explain the specific issue you posted about here, which had nothing to do with keyboard input. If you are the same person, you have already been told by the mods that that is not permitted here. If you're not the same person, you likely soon will be told.
-
Sep 7th, 2021, 09:50 AM
#20
Re: click on PictureBox vb.net help me
Let's just assume he is, since it's pretty clear.
My usual boring signature: Nothing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|