Bloc De Notas En Vb.Net

Páginas: 2 (271 palabras) Publicado: 28 de enero de 2013
PARA UN BLOC DE NOTAS

PRIMERO CREAR :

-1 TextBox
-1 Menu Strip

LUEGO EN LA BARRA DE PROPIEDADES CAMBIAR EL NAME DEL TEXBOX POR DOCUMENT Y EN EL MENU STRIP CREAR TRES SUB-MENUS:
ARCHIVO ,EDICION Y FORMATO

• EN ARCHIVO: ABRIR , GUARDAR Y SALIR
• EN EDICION: DESHACER, COPIAR , PEGAR . CORTAR , SELECCIONAR TODO Y LIMPIAR TEXTO
• EN FORMATO: FUENTE Y COLOR

AGREGAR1 SaveFileDialog, 1 OpenFileDialog, 2 ColorDialog, 1 FontDialog, 1 Printdialog y 1 PrintDocument

LOS CODIGOS SON :

Para Abrir:

Dim Open As New OpenFileDialog()
Dim myStreamReader AsSystem.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

Para Guardar:

Dim Save As New SaveFileDialog()
Dim myStreamWriter AsSystem.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

Para Salir :

Me.Close()Para Copiar:

document.copy()

Para Cortar:

document.Cut()

Para Pegar:

document.Paste()

Para Deshacer:

document.Undo()

Para Fuente:

Try
Dim dlg As FontDialog = NewFontDialog
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

Para Color:

Try
Dimdlg 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...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • bloc de notas
  • bloc de notas
  • Bloc de notas
  • Bloc de Notas
  • Bloc de Notas
  • codigos para el bloc de nota
  • Leccion 4 El Bloc de Notas
  • HISTORIA DE BLOC DE NOTAS

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS