VC for VS 2015 - form buttons

I am building a calculator and have four buttons they used to work , so I must have accidentally changed something. Can some tell me how these aremade active? Is it in the properties?   

  • Verified Answer

    Buttons are tied to event handlers so that when an action occurs like button_Clicked then the event handler method will automatically be invoked. Double-clicking on the button should have inserted the event handler code into your program and inserted the code that adds the event handler method into the .designer.cbl file for the form.

    You should be able to see if the event handlers are still in place by selecting the button and then clicking on the lightning bolt icon in the properties window which shows all of the event handlers tied to the control. Is there a handler for the button_Clicked event?
  • I am curious as to what version of Visual COBOL you are on as we have experienced this on 2.2 as well. In our experience all of the event handlers have lost their connection (for some unknown reason) and you must go to the properties like Chris states and re-hook the event handler to the click, load, or other event. If you do not have many that is easily done, but if you have several it can be a pain and also a possibility to forget some. We have got into the habit of saving a copy of our work and using a compare tool to replace these event handlers much quicker (this is especially helpful if you have many event handlers in your program). We have tested 2.3 and it did not seem to have this problem, but we only did some brief testing where we tried to do some things that seemed to cause this problem. Thus my curiosity of what version you are using.

    Thank you
  • P.S. I tried deleting and re-adding the button as a new one and also copied one that works and changed the text and name with no luck.
  • The problem I encountered is that the click event in the properties of the button would be blank and I would have to reset it using the drop down box to select the proper event I needed for it to run otherwise it would not work at all. If I double-clicked the button (In designer mode) it would just create another click event (btnAccept_Click(2)) that would be blank. We encounter this regularly in 2.2 and I was hoping it would be fixed in 2.3, but it sounds like it is still doing the same thing.

  • Verified Answer

    There was not but I added it and all is well!