|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace EventAndDelegate
{
public partial class Form2 : Form
{
private Subject objSub;
Form3 frm;
public Form2()
{
InitializeComponent();
objSub = new Subject();
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void btnOpen_Click(object sender, EventArgs e)
{
frm = new Form3(objSub);
frm.Show();
}
private void rdRed_CheckedChanged(object sender, EventArgs e)
{
if (rdRed.Checked)
{
objSub.UpdateClient("RED");
lblText.ForeColor = Color.Red;
}
}
private void rdGreen_CheckedChanged(object sender, EventArgs e)
{
if (rdGreen.Checked)
{
objSub.UpdateClient("GREEN");
lblText.ForeColor = Color.Green;
}
}
private void rdBlue_CheckedChanged(object sender, EventArgs e)
{
if (rdBlue.Checked)
{
objSub.UpdateClient("BLUE");
lblText.ForeColor = Color.Blue;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.