Answers for "write listbox to text file vb.net"

VBA
0

write listbox to text file vb.net

Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
    If SaveFD.ShowDialog() = DialogResult.OK Then
        Dim sb As New System.Text.StringBuilder()

        For Each o As Object In ListBox1.Items
            sb.AppendLine(o)
        Next

        System.IO.File.WriteAllText("c:\mypath\output.txt", sb.ToString())
    End If
End Sub
Posted by: Guest on October-21-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language