This document contains the code for a Windows form application written in VB.NET. It includes event handler subroutines for various form controls like buttons, checkboxes, listboxes and scrollbars. The event handlers modify properties of textbox controls like font style, color, and read-only status in response to user input. An about box is also displayed when a help menu item is clicked.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
80 views2 pages
Controles
This document contains the code for a Windows form application written in VB.NET. It includes event handler subroutines for various form controls like buttons, checkboxes, listboxes and scrollbars. The event handlers modify properties of textbox controls like font style, color, and read-only status in response to user input. An about box is also displayed when a help menu item is clicked.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Public Class Form1
Private Sub ttBotonAñadir_Popup(ByVal sender As System.Object, ByVal
e As System.Windows.Forms.PopupEventArgs) Handles ttBotonAñadir.Popup
End Sub
Private Sub btAñadir_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btAñadir.Click If (ctDato.Text <> "") Then lsLista.Items.Add(ctDato.Text) End Sub
Private Sub cvCursiva_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cvCursiva.CheckedChanged If (cvCursiva.Checked) Then ' si cvCursiva esta Señalada ctDato.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Italic) Else ' si Cursiva no esta Señalada ctDato.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Regular) End If End Sub
Private Sub boLectura_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles boLectura.CheckedChanged ctDato.ReadOnly = True End Sub
Private Sub boEscritura_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles boEscritura.CheckedChanged ctDato.ReadOnly = False End Sub
Private Sub bdhColorTexto_Scroll(ByVal sender As System.Object, ByVal
e As System.Windows.Forms.ScrollEventArgs) Handles bdhColorTexto.Scroll ctDato.ForeColor = Color.FromArgb(bdhColorTexto.Value, bdhColorTexto.Value, bdhColorTexto.Value) End Sub
Private Sub lsLista_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles lsLista.SelectedIndexChanged ctDato.Text = lsLista.SelectedItem End Sub
Private Sub SalirToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles separador.Click Close() End Sub
Private Sub itOpcionesColor_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles itOpcionesColor.Click 'Establece el color actual de la caja de texto como inicial dlgColor.Color = ctDato.BackColor 'Mostrar el dialogo dlgColor If (dlgColor.ShowDialog() = DialogResult.OK) Then ' Si se pulso Aceptar, establecer el color de fondo de la ' caja de texto ctDato.BackColor = dlgColor.Color End If End Sub
Private Sub itAyudaAcercade_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles itAyudaAcercade.Click MessageBox.Show("Aplicacion Controles. Version 1.0" + Environment.NewLine + "Copyright(c) Fco. Javier Ceballos, 2005", "Acerca de Controles", MessageBoxButtons.OK, MessageBoxIcon.Information) End Sub End Class