Imports System.IO Public Class Form2 Private Sub BTNG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNG.Click Dim sw As StreamWriter With Me.sfd .Title = "guardar archivo de texto" .Filter = "ARCHIVOS DE TEXTO (*.txt)|*.txt|todos los archivos (*.*)|*.*" If .ShowDialog = 1 Then sw = File.CreateText(.FileName) sw.WriteLine("datos personales") sw.WriteLine("=======================") sw.WriteLine("codigo: " & TXTCO.Text) sw.WriteLine("nombre:" & TXTNO.Text) sw.WriteLine("APELLIDOS:" & TXTA.Text) sw.WriteLine("DIRECCION:" & TXTDI.Text) sw.WriteLine("F.NACIMIENTO:" & TXTF.Text) sw.WriteLine("TELEFONO:" & TXTT.Text) sw.Close() MessageBox.Show("archivo generado, en la ubicacion:" & vbCrLf & .FileName, "carosoft", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End If End With End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim vale As Object For Each vale In GroupBox1.Controls If TypeOf vale Is TextBox Then vale.clear() End If Next End Sub Private Sub BTNS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNS.Click Me.Close() End Sub End Class