Les dejo aqui los codigos:
Abrir:
Dim Open As New OpenFileDialog()
Dim myStreamReader As System.IO.StreamReader
Open.Filter = "Text [*.txt*]|*.txt|All Files [*,*]|*,*"
Open.CheckFileExists = True
Open.Title = "Abrir Archivo"
Open.ShowDialog(Me)
Try
Open.OpenFile()
myStreamReader = System.IO.File.OpenText(Open.FileName)
document.Text = myStreamReader.ReadToEnd()
Catch ex As Exception
End Try
Guardar:
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text (*.txt)|*.txt|HTML(*.html*)|*.html|PHP(*.php*)|*.php*|All files(*.*)|*.*"
Save.CheckPathExists = True
Save.Title = "Guardar como"
Save.ShowDialog(Me)
Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(document.text)
myStreamWriter.Flush()
Catch ex As Exception
End Try
Copiar: document.copy()
Cortar: document.Cut()
Pegar: document.Paste()
Undo: document.Undo()
Redo: document.Redo()
Fuente:
Try Dim dlg As FontDialog = New FontDialog dlg.Font = document.font If dlg.showdialog = System.Windows.Forms.DialogResult.OK Then document.Font = dlg.Font End If
Catch ex As Exception: End Try
Color:
Try Dim dlg As ColorDialog = New ColorDialog dlg.Color = document.Forecolor If dlg.ShowDialog = System.Windows.Forms.DialogResult.Ok Then document.Forecolor = dlg.Color End If
Catch ex As Exception
End Try
Abrir:
Dim Open As New OpenFileDialog()
Dim myStreamReader As System.IO.StreamReader
Open.Filter = "Text [*.txt*]|*.txt|All Files [*,*]|*,*"
Open.CheckFileExists = True
Open.Title = "Abrir Archivo"
Open.ShowDialog(Me)
Try
Open.OpenFile()
myStreamReader = System.IO.File.OpenText(Open.FileName)
document.Text = myStreamReader.ReadToEnd()
Catch ex As Exception
End Try
Guardar:
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text (*.txt)|*.txt|HTML(*.html*)|*.html|PHP(*.php*)|*.php*|All files(*.*)|*.*"
Save.CheckPathExists = True
Save.Title = "Guardar como"
Save.ShowDialog(Me)
Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(document.text)
myStreamWriter.Flush()
Catch ex As Exception
End Try
Copiar: document.copy()
Cortar: document.Cut()
Pegar: document.Paste()
Undo: document.Undo()
Redo: document.Redo()
Fuente:
Try Dim dlg As FontDialog = New FontDialog dlg.Font = document.font If dlg.showdialog = System.Windows.Forms.DialogResult.OK Then document.Font = dlg.Font End If
Catch ex As Exception: End Try
Color:
Try Dim dlg As ColorDialog = New ColorDialog dlg.Color = document.Forecolor If dlg.ShowDialog = System.Windows.Forms.DialogResult.Ok Then document.Forecolor = dlg.Color End If
Catch ex As Exception
End Try
Otro código
Los codigos son:
Nuevo:
document.Clear
Abrir:
Dim open As New OpenFileDialog Dim myStreamReader As System.IO.StreamReader open.Filter = "Text[*.txt*]|*.txt|All Files [*.*]|*.*" open.CheckFileExists = True open.Title = "Abrir Archivo" open.ShowDialog(Me) Try open.OpenFile() myStreamReader = System.IO.File.OpenText(open.FileName) document.Text = myStreamReader.ReadToEnd Catch ex As Exception End Try
Guardar Como:
Dim save As New SaveFileDialog Dim myStreamWriter As System.IO.StreamWriter save.Filter = "Text (*.txt)|*.txt|HTML(*.html*)|*.html|PHP(*.php*)|*.php*|All Files(*.*)|*.*" save.CheckPathExists = True save.Title = "Guardar Como" save.ShowDialog(Me) Try myStreamWriter = System.IO.File.AppendText(save.FileName) myStreamWriter.Write(document.Text) myStreamWriter.Flush() Catch ex As Exception End Try
Salir:
End
Deshacer:
document.Undo
Rehacer:
document.Redo
Copiar:
document.Copy
Pegar:
document.Paste
Cortar:
document.Cut
Seleccionar Todo:
document.SelectAll
Limpiar Texto:
document.Clear
Fuente:
Try Dim dlg As FontDialog = New FontDialog dlg.Font = document.Font If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then document.Font = dlg.Font End If Catch ex As Exception End Try
Color de Fuente:
Try Dim dlg As ColorDialog = New ColorDialog dlg.Color = document.ForeColor If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then document.ForeColor = dlg.Color End If Catch ex As Exception End Try
Color de Fondo:
Try Dim dlg As ColorDialog = New ColorDialog dlg.Color = document.BackColor If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then document.BackColor = dlg.Color End If Catch ex As Exception End Try
Nuevo:
document.Clear
Abrir:
Dim open As New OpenFileDialog Dim myStreamReader As System.IO.StreamReader open.Filter = "Text[*.txt*]|*.txt|All Files [*.*]|*.*" open.CheckFileExists = True open.Title = "Abrir Archivo" open.ShowDialog(Me) Try open.OpenFile() myStreamReader = System.IO.File.OpenText(open.FileName) document.Text = myStreamReader.ReadToEnd Catch ex As Exception End Try
Guardar Como:
Dim save As New SaveFileDialog Dim myStreamWriter As System.IO.StreamWriter save.Filter = "Text (*.txt)|*.txt|HTML(*.html*)|*.html|PHP(*.php*)|*.php*|All Files(*.*)|*.*" save.CheckPathExists = True save.Title = "Guardar Como" save.ShowDialog(Me) Try myStreamWriter = System.IO.File.AppendText(save.FileName) myStreamWriter.Write(document.Text) myStreamWriter.Flush() Catch ex As Exception End Try
Salir:
End
Deshacer:
document.Undo
Rehacer:
document.Redo
Copiar:
document.Copy
Pegar:
document.Paste
Cortar:
document.Cut
Seleccionar Todo:
document.SelectAll
Limpiar Texto:
document.Clear
Fuente:
Try Dim dlg As FontDialog = New FontDialog dlg.Font = document.Font If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then document.Font = dlg.Font End If Catch ex As Exception End Try
Color de Fuente:
Try Dim dlg As ColorDialog = New ColorDialog dlg.Color = document.ForeColor If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then document.ForeColor = dlg.Color End If Catch ex As Exception End Try
Color de Fondo:
Try Dim dlg As ColorDialog = New ColorDialog dlg.Color = document.BackColor If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then document.BackColor = dlg.Color End If Catch ex As Exception End Try
0 comentarios:
Publicar un comentario