I have been writing code in VB for 30+ years up thru VB6. I had not moved to VB.Net as I was close to retirement. I've been retired for more than 10 years now. For the fun of it I decided to improve myself by trying to move to VB.Net. Although I am comfortable with VB I am very much a newbe in VB.Net. I apologize if that shows in the simplicity of a problem I have run into.
I have been trying to re-write a program in VB.Net that works quite well in VB. My VB.Net program requires a text file that meets certain criteria to continue. In the form load event of my main form I use OpenFileDialog to allow the user to select a file. I use an IF Then_Else_End If structure to respond to the 2 dialog buttons. When Cancel is selected, I use MsgBox to offer the user the option of ending the program or selecting a file. If a file is selected I test that the file meets needed criteria. If the file fails the test I use MsgBox to offer the user the option of ending the program or selecting a new file. My problem is this, when I run the code and put in a breakpoint I can successfully step through all of the selection options with all of the message box dialogs properly firing. When I remove the breakpoint and run the code, none of the message boxes fire and the code seems to hang in a loop. I thought MsgBox was modal and the program should stop and wait for a user response when MsgBox is triggered. Any comments as to what may be happeninmg or any suggestions to how to fix the problem would be appreciated. I can provide my code but as I said I can successfully step through the code but I cannot run it automatically.
I have been trying to re-write a program in VB.Net that works quite well in VB. My VB.Net program requires a text file that meets certain criteria to continue. In the form load event of my main form I use OpenFileDialog to allow the user to select a file. I use an IF Then_Else_End If structure to respond to the 2 dialog buttons. When Cancel is selected, I use MsgBox to offer the user the option of ending the program or selecting a file. If a file is selected I test that the file meets needed criteria. If the file fails the test I use MsgBox to offer the user the option of ending the program or selecting a new file. My problem is this, when I run the code and put in a breakpoint I can successfully step through all of the selection options with all of the message box dialogs properly firing. When I remove the breakpoint and run the code, none of the message boxes fire and the code seems to hang in a loop. I thought MsgBox was modal and the program should stop and wait for a user response when MsgBox is triggered. Any comments as to what may be happeninmg or any suggestions to how to fix the problem would be appreciated. I can provide my code but as I said I can successfully step through the code but I cannot run it automatically.
Last edited by a moderator: