using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication2 { public partial class Smiler : Form { // Variable Declaration string[] keys = new string[47]; string[] data = new string[47]; public Smiler() { InitializeComponent(); button1.Text = "Copy Image"; label1.Text = "Forum Image Code"; label2.Text = "Balloon!"; // continuing with Array declaration keys[0] = "Balloon"; data[0] = @"[IMG]http://www.mreggsalad.net/smile/balloon.gif[/IMG]"; } private int findKey(string keyName) { for (int a = 0; a < keys.Length; a++) { if (keys[a] == keyName) { return a; } } return -1; } private void pictureBox1_Click(object sender, EventArgs e) { textBox1.Text = @"[IMG]http://www.mreggsalad.net/smile/balloon.gif[/IMG]"; } private void label2_Click(object sender, EventArgs e) { textBox1.Text = @"[IMG]http://www.mreggsalad.net/smile/balloon.gif[/IMG]"; } private void pictureBoxAll_Click(object sender, EventArgs e) { string name = ((System.Windows.Forms.PictureBox)sender).Name.ToString(); int strLink = findKey("Balloon"); textBox1.Text = data[strLink]; System.Console.WriteLine("sender: {0}! EventArgs: {1}! Name: {2}", sender, e, name.ToString()); } private void button1_Click(object sender, EventArgs e) { Clipboard.SetDataObject(textBox1.Text, false); } private void labelAll_Click(object sender, EventArgs e) { textBox1.Text = @"[IMG]http://www.mreggsalad.net/smile/balloon.gif[/IMG]"; } } }