using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp1 { public partial class Form1 : Form { public static uint counter = 1; public Form1() { InitializeComponent(); } /* public void Slacker_Button_Press(Object sender, EventArgs args) { MessageBox.Show("Hello world!"); AddItem_Button.Text = "Not Slacker"; } */ private void Output_ListBox_Click(object sender, EventArgs e) { // stuff and things } public string ToString(string mode) { if (mode == "ListBox") // provide alternate format for when we display it there } private void Output_ListBox_SelectedValueChanged(object sender, EventArgs e) { if (Output_ListBox.SelectedIndex == -1) return; MessageBox.Show(String.Format("Index = {0}, Item = {1}", Output_ListBox.SelectedIndex.ToString(), Output_ListBox.SelectedItem.ToString())); // If no item has been selected // then Output_ListBox.SelectedIndex == -1 } private void AddItem_Button_Click(object sender, EventArgs e) { Output_ListBox.Items.Add(String.Format("Message #{0}", counter++)); } private void Reset_Button_Click(object sender, EventArgs e) { Output_ListBox.SelectedIndex = -1; richTextBox1.Clear(); richTextBox1.AppendText("ListBox index value has been reset.\n"); } private void checkBox1_Click(object sender, EventArgs e) { if (checkBox1.Checked) label3.Text = "100"; else label3.Text = ""; } /* * if (radioButton1.Checked) // do radio button 1 things * else if (radioButton2.Checked) // do radio button 2 things * so forth and so on * * */ } }