I maintain a number of VB6 apps and in each case they start with a plain screen which acts as a menu. The menu itself consists of a number of option controls. When the user clicks an option, Sub optMenuOption_Click(Index As Integer) is fired and the relevant option is triggered.
However, on most of the apps, if I simply display the menu then give another app the focus and then return focus to the VB6 app, nothing happens, ie Sub optMenuOption_Click(Index As Integer) is not triggered which is exactly as I want it to be. However in just one case, returning focus does trigger Sub optMenuOption_Click(Index As Integer), where Index = 25 (oddly, not the highest option index nor the last option chosen by the user nor the last referred to in the code).
For the life of me I can't see what the difference is in this case. I've compared the code, checked form and application properties...all the no avail. I've tried to see if I can distinguish between a "real" click, ie one by the user, on option 25, and the return focus event, but can't see how as both a user-selected and the result of the return of focus trigger optMenuOption_Click with nothing above it in the call stack.
Any suggestions greatly appreciated.
However, on most of the apps, if I simply display the menu then give another app the focus and then return focus to the VB6 app, nothing happens, ie Sub optMenuOption_Click(Index As Integer) is not triggered which is exactly as I want it to be. However in just one case, returning focus does trigger Sub optMenuOption_Click(Index As Integer), where Index = 25 (oddly, not the highest option index nor the last option chosen by the user nor the last referred to in the code).
For the life of me I can't see what the difference is in this case. I've compared the code, checked form and application properties...all the no avail. I've tried to see if I can distinguish between a "real" click, ie one by the user, on option 25, and the return focus event, but can't see how as both a user-selected and the result of the return of focus trigger optMenuOption_Click with nothing above it in the call stack.
Any suggestions greatly appreciated.