none
strange behavior of GUI in visual basic RRS feed

  • Question

  • My applications have many forms with several objects.

    When you click on an objet its code will appear (then you can choose wich event....).

    But often, clicking on the graphic objetc, it shows a point not related to it. The mouse is pointing to, sometimes, random positions.

    Sometimes it opens a second empty event, notwistandind the fact that it exist.

    My visual studio version is updated (Version16.4.3)

    Friday, January 31, 2020 11:33 PM

Answers

  • Dear friends, I have found what it was.

    On my form there are many checkboxes (32). Cliccking on one it appears:

    Private Sub Check13_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles Check13.CheckedChanged
    'my code is here  
    End Sub

     but for some checkbox was:

    Private Sub Check7_CheckedChanged(sender As System.Object, e As System.EventArgs) 
           
    End Sub

    the "handles" part was missing.  Thanks for your help.

    Enzo

    When you delete a control in the designer view, if you have event handler code then Visual Studio will remove the handles clause to the old control that no longer exists. Then the project will still run but you think you have code but it is not working.

    You can make a list of controls and have just one event handler sub routine for all 32 check boxes if they are all similar. We can show you how if you want to learn it.

    Finally, you can mark your post as the answer to this thread now that you know the answer. This closes the thread and lets others know your solution if any. I marked it as proposed answer now you can mark it as THE ANSWER!



    Saturday, February 1, 2020 9:29 AM

All replies

  • Many unknowns here

    • In regards to several objects, everything is an object so please be specific about the objects.
    • "When you click on an object its code will appear" I have no clue here, please be very specific to what you mean.
    • In regards to clicking on graphic objects, again not clear enough.
    • It shows a point not related to it, again unclear to what you mean
    • "Sometimes it open a second empty event", there should be no empty events in your code, clean up the code.
    • Visual Studio version should not matter after VS2015.

    Finally, please indicate if this is a brand new project or an existing project ported to a newer version of Visual Studio.

    Feel free to add more details as needed for those here looking to assist have all the details.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, January 31, 2020 11:48 PM
    Moderator
  • My applications have many forms with several objects.

    When you click on an objet its code will appear (then you can choose wich event....).

    But often, clicking on the graphic objetc, it shows a point not related to it. The mouse is pointing to, sometimes, random positions.

    Sometimes it opens a second empty event, notwistandind the fact that it exist.

    My visual studio version is updated (Version16.4.3)

    Hi

    What do you mean with 'it shows a point not related to it.'?


    Regards Les, Livingston, Scotland

    Friday, January 31, 2020 11:49 PM
  • Can you elaborate what "graphic objetc" you are referring to is?

    Just another control or picture control?


    George Frias - AWWshop @ Wikidot, Wiki1978

    Saturday, February 1, 2020 12:31 AM
  • Dear friends, I have found what it was.

    On my form there are many checkboxes (32). Cliccking on one it appears:

    Private Sub Check13_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles Check13.CheckedChanged
    'my code is here  
    End Sub

     but for some checkbox was:

    Private Sub Check7_CheckedChanged(sender As System.Object, e As System.EventArgs) 
           
    End Sub

    the "handles" part was missing.  Thanks for your help.

    Enzo

    • Proposed as answer by tommytwotrain Saturday, February 1, 2020 9:30 AM
    Saturday, February 1, 2020 8:57 AM
  • Dear friends, I have found what it was.

    On my form there are many checkboxes (32). Cliccking on one it appears:

    Private Sub Check13_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles Check13.CheckedChanged
    'my code is here  
    End Sub

     but for some checkbox was:

    Private Sub Check7_CheckedChanged(sender As System.Object, e As System.EventArgs) 
           
    End Sub

    the "handles" part was missing.  Thanks for your help.

    Enzo

    When you delete a control in the designer view, if you have event handler code then Visual Studio will remove the handles clause to the old control that no longer exists. Then the project will still run but you think you have code but it is not working.

    You can make a list of controls and have just one event handler sub routine for all 32 check boxes if they are all similar. We can show you how if you want to learn it.

    Finally, you can mark your post as the answer to this thread now that you know the answer. This closes the thread and lets others know your solution if any. I marked it as proposed answer now you can mark it as THE ANSWER!



    Saturday, February 1, 2020 9:29 AM