Práctica 4. Propiedades de control
Objetivo: Elaborar la siguiente aplicación en C#
Código:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Practica_4
{
public partial class FrmPropiedades : Form
{
public FrmPropiedades()
{
InitializeComponent();
}
private void btnMostrar_Click(object sender, EventArgs e)
{
txtBox2.Visible = true;
}
private void btnOcultar_Click(object sender, EventArgs e)
{
txtBox2.Visible = false;
}
private void btnBloquear_Click(object sender, EventArgs e)
{
txtBox2.Enabled = false;
}
private void btnDesbloquear_Click(object sender, EventArgs e)
{
txtBox2.Enabled = true;
}
private void btnEnviartex_Click(object sender, EventArgs e)
{
txtBox2.Text = txtBox1.Text;
}
private void btnLimpartex_Click(object sender, EventArgs e)
{
txtBox1.Text = "";
txtBox2.Clear();
}
private void btnSalir_Click(object sender, EventArgs e)
{
Close();
}
private void btnCamColor_Click(object sender, EventArgs e)
{
try
{
txtBox2.ForeColor = System.Drawing.Color.FromName(cmb.Text);
}
catch
{
MessageBox.Show("Debe
Seleccionar Un Color De La Lista");
}
}
private void btnCamFondo_Click(object sender, EventArgs e)
{
try
{
txtBox2.BackColor = System.Drawing.Color.FromName(cmb.Text);
}
catch
{
MessageBox.Show("Debe
seleccionar un color de la lista");
}
}
}
No hay comentarios:
Publicar un comentario