Neodude1123201
Bogan
- Messages
- 8,474
- Location
- Australia
Ok,here is the part of the code i need help with:
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Dim FileToCopy As String
Dim NewCopy As String
FileToCopy = Form1.add.FileName
NewCopy = "C:\" + TextBox1.Text + ".ink"
If System.IO.File.Exists("C:\" + TextBox1.Text + ".ink") = True Then MsgBox("File Already Exist's")
If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy)
MsgBox("Shortcut Added")
Me.Close()
End If
End Sub
If you notice on line 8,if a file already exists with the same name,a message box appears,but the script continues,how can i make this text make that message box appear,THEN allow the user to re-enter a name?
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Dim FileToCopy As String
Dim NewCopy As String
FileToCopy = Form1.add.FileName
NewCopy = "C:\" + TextBox1.Text + ".ink"
If System.IO.File.Exists("C:\" + TextBox1.Text + ".ink") = True Then MsgBox("File Already Exist's")
If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy)
MsgBox("Shortcut Added")
Me.Close()
End If
End Sub
If you notice on line 8,if a file already exists with the same name,a message box appears,but the script continues,how can i make this text make that message box appear,THEN allow the user to re-enter a name?