[Solved] Set form’s name equal dragged and dropped file title vb


You’ve already got the filename in your tempstr variable, just use it:

    Dim tempstr As String = arguments.Replace("""", "")
    Me.Text = tempstr & " - YourTextEditorNameHere"    
    Dim SR As New System.IO.StreamReader(tempstr)

If you don’t want the full path, use Path.GetFileName():

    Dim tempstr As String = arguments.Replace("""", "")
    Me.Text = System.IO.Path.GetFileName(tempstr) & " - YourTextEditorNameHere"    
    Dim SR As New System.IO.StreamReader(tempstr)

And if you don’t want the extension, use Path.GetFileNameWithoutExtension():

    Dim tempstr As String = arguments.Replace("""", "")
    Me.Text = System.IO.Path.GetFileNameWithoutExtension(tempstr) & " - YourTextEditorNameHere"    
    Dim SR As New System.IO.StreamReader(tempstr)

1

solved Set form’s name equal dragged and dropped file title vb