Results 1 to 20 of 20

Thread: click on PictureBox vb.net help me

  1. #1

    Thread Starter
    Banned
    Join Date
    Sep 2021
    Posts
    6

    Exclamation click on PictureBox vb.net help me

    hello
    How can I click on the PictureBox using a button inside the form?
    Name:  ph.jpg
Views: 391
Size:  17.5 KB
    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.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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?

  3. #3

    Thread Starter
    Banned
    Join Date
    Sep 2021
    Posts
    6

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by jmcilhinney View Post
    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

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  5. #5

    Thread Starter
    Banned
    Join Date
    Sep 2021
    Posts
    6

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by jmcilhinney View Post
    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 ?

  6. #6
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    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)

  7. #7
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by Delaney View Post
    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

  8. #8
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    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)

  9. #9
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by Delaney View Post
    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.

  10. #10
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: click on PictureBox vb.net help me

    the OP said

    Quote Originally Posted by JohnMar View Post
    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)

  11. #11
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by Delaney View Post
    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.

  12. #12
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by JohnMar View Post
    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.

  13. #13

    Thread Starter
    Banned
    Join Date
    Sep 2021
    Posts
    6

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by jmcilhinney View Post
    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

  14. #14
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: click on PictureBox vb.net help me

    Looks like HeroCode has a new account

  15. #15
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by JohnMar View Post
    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.

  16. #16

    Thread Starter
    Banned
    Join Date
    Sep 2021
    Posts
    6

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by jmcilhinney View Post
    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

  17. #17
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  18. #18

    Thread Starter
    Banned
    Join Date
    Sep 2021
    Posts
    6

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by jmcilhinney View Post
    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

  19. #19
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: click on PictureBox vb.net help me

    Quote Originally Posted by JohnMar View Post
    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.

  20. #20
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    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
  •  



Click Here to Expand Forum to Full Width