ejercicio 4 visual basic (1)

4
Ejercicio: Modificar Texto Esta aplicación permitirá sirve como introducción para la realización de cambios en el aspecto de un texto, mediante la programación. Se abrirá un formulario que permite introducir el texto deseado. Con esta aplicación se podrán cambiar tres cualidades del texto: Tamaño de la letra, estilo y Color. El mensaje con el que se va a trabajar puede ser modificado seleccionando estilo de fuente Negrita: permite modificar el texto ingresado por el usuario Cursiva: admite cambios al texto Subrayado: Aplica el formato de subrayado al texto Para cambiar el tamaño se dispone de 2 Button (+, -) que permite al usuario variar la altura del texto. En cuanto al estilo, el usuario podrá seleccionar entre negrita, cursiva o Subrayado. De la misma manera, podrá seleccionar entre el color, tamaño, y fuente

Upload: cartrual

Post on 06-Dec-2015

2 views

Category:

Documents


1 download

DESCRIPTION

VISUAL BASIC

TRANSCRIPT

Page 1: Ejercicio 4 Visual Basic (1)

Ejercicio: Modificar Texto

Esta aplicación permitirá sirve como introducción para la realización de cambios en el aspecto de un texto, mediante la programación.

Se abrirá un formulario que permite introducir el texto deseado.

Con esta aplicación se podrán cambiar tres cualidades del texto: Tamaño de la letra, estilo y Color.

El mensaje con el que se va a trabajar puede ser modificado seleccionando estilo de fuente

Negrita: permite modificar el texto ingresado por el usuario

Cursiva: admite cambios al texto

Subrayado: Aplica el formato de subrayado al texto

Para cambiar el tamaño se dispone de 2 Button (+, -) que permite al usuario variar la altura del texto.

En cuanto al estilo, el usuario podrá seleccionar entre negrita, cursiva o Subrayado.

De la misma manera, podrá seleccionar entre el color, tamaño, y fuente

FORMULARIO PRINCIPAL

Public Class Form1 Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs)

End Sub

Page 2: Ejercicio 4 Visual Basic (1)

Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked = True Then TextBox1.Font = New Font("Arial", 12, FontStyle.Bold) Else TextBox1.Font = New Font("Arial", 12, FontStyle.Regular)

End If End Sub

Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged If CheckBox2.Checked = True Then TextBox1.Font = New Font("Arial", 12, FontStyle.Italic) Else TextBox1.Font = New Font("Arial", 12, FontStyle.Regular) End If End Sub

Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged If CheckBox3.Checked = True Then TextBox1.Font = New Font("Arial", 12, FontStyle.Underline) Else TextBox1.Font = New Font("Arial", 12, FontStyle.Regular) End If End Sub

Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged If CheckBox4.Checked = True Then TextBox1.ForeColor = Color.Coral Else TextBox1.ForeColor = Color.Black End If End Sub

Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.CheckedChanged If CheckBox5.Checked = True Then Me.TextBox1.Font = New System.Drawing.Font("Fabian Ortiz", 20.0) Else Me.TextBox1.Font = New System.Drawing.Font("Fabian Ortiz", 14.0)

End If End Sub

Private Sub CheckBox6_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox6.CheckedChanged If CheckBox6.Checked = True Then Me.TextBox1.Font = New System.Drawing.Font("papyrus", 12.0) Else Me.TextBox1.Font = New System.Drawing.Font("Fabian Ortiz", 14.0)

Page 3: Ejercicio 4 Visual Basic (1)

End If End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click TextBox1.Font = New Font(TextBox1.Font.Size, TextBox1.Font.Size + 2) End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click TextBox1.Font = New Font(TextBox1.Font.Size, TextBox1.Font.Size - 2) End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click TextBox1.Text = ""

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click End End Sub

Private Sub CheckBox3_CheckedChanged_1(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged If CheckBox3.Checked = True Then TextBox1.Font = New Font("Arial", 12, FontStyle.Underline) Else TextBox1.Font = New Font("Arial", 12, FontStyle.Regular) End If End SubEnd Class