I want to ask the user if he wants to overwrite the file or not. If he says "no" the program continues running. How do I make it wait until he enters the new filename and presses START again?
Thanks for any suggestions,
Contadino
Here is my If then loop:
Thanks for any suggestions,
Contadino
Here is my If then loop:
VB.NET:
'Check if file already exists, "Do you want to overwrite?"
If My.Computer.FileSystem.FileExists(LSVDAQ) Then
response2 = MsgBox("File already exists, overwrite?", MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation)
If response2 = MsgBoxResult.No Then
MyStartButton.Enabled = True
MyStopButton.Enabled = False
MsgBox("Enter new filename")
ElseIf response2 = MsgBoxResult.Yes Then
MsgBox("File " & LSVDAQ & " will be created")
End If
Else
response2 = MsgBox("File " & LSVDAQ & " will be created")
End If
Last edited by a moderator: