Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Lecture_3
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.  
  19.         }
  20.  
  21.         private void groupBox1_Enter(object sender, EventArgs e)
  22.         {
  23.             //if (checkBox1.Checked)
  24.               //  MessageBox.Show("CheckBox1 is checked");
  25.         }
  26.  
  27.         private void checkBox2_CheckedChanged(object sender, EventArgs e)
  28.         {
  29.             MessageBox.Show("Hell no, that's not the best type");
  30.         }
  31.  
  32.         private void Form1_Load(object sender, EventArgs e)
  33.         {
  34.  
  35.         }
  36.  
  37.         private void button1_Click(object sender, EventArgs e)
  38.         {
  39.             //if (checkBox1.CheckState == CheckState.Checked)
  40.             //    MessageBox.Show("It's checked\n");
  41.             //if(checkBox1.CheckState == CheckState.Unchecked)
  42.             //    MessageBox.Show("It's not checked\n");
  43.             //if(checkBox1.CheckState == CheckState.Indeterminate)
  44.             //    MessageBox.Show("It's indeterminate\n");
  45.         }
  46.  
  47.         private void radioButton5_CheckedChanged(object sender, EventArgs e)
  48.         {
  49.  
  50.         }
  51.  
  52.         private void radioButton3_CheckedChanged(object sender, EventArgs e)
  53.         {
  54.            
  55.         }
  56.  
  57.         private void pictureBox1_Click(object sender, EventArgs e)
  58.         {
  59.  
  60.         }
  61.  
  62.         private void ClickMe_Popup(object sender, PopupEventArgs e)
  63.         {
  64.  
  65.         }
  66.  
  67.         private void numericUpDown1_ValueChanged(object sender, EventArgs e)
  68.         {
  69.             MessageBox.Show(numericUpDown1.Value.ToString());
  70.             label7.Text = "Selected Value =" + numericUpDown1.Value;
  71.             //The concatination in C# does an implicit conversion for the Data type That's why
  72.             //We didn't have to put ToString() in the second shit
  73.  
  74.         }
  75.  
  76.         private void remove_selected_button_Click(object sender, EventArgs e)
  77.         {
  78.      
  79.         }
  80.  
  81.         private void button2_Click(object sender, EventArgs e)
  82.         {
  83.             for(int i=0;i<101;i++)
  84.             checkedListBox1.Items.Add(i);
  85.  
  86.         }
  87.  
  88.         private void button3_Click(object sender, EventArgs e)
  89.         {
  90.             listBox.Items.RemoveAt(listBox.SelectedIndex);//RemoveAt takes the index not the string
  91.            
  92.         }
  93.  
  94.         private void button4_Click(object sender, EventArgs e)
  95.         {
  96.             listBox.Items.Clear();
  97.             if (checkedListBox1.GetItemChecked(1))
  98.                 MessageBox.Show("checkedListBox's Item 1 is checked");
  99.             MessageBox.Show(checkedListBox1.CheckedItems[2].ToString());
  100.             //Originally it's an object, so we change it to string because a message box does not accept anything
  101.             //but strings
  102.         }
  103.  
  104.         private void listBox_SelectedIndexChanged(object sender, EventArgs e)
  105.         {
  106.  
  107.         }
  108.  
  109.         private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
  110.         {
  111.  
  112.         }
  113.  
  114.         private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  115.         {
  116.  
  117.         }
  118.  
  119.         private void menuStrip1_ItemClicked_1(object sender, ToolStripItemClickedEventArgs e)
  120.         {
  121.  
  122.         }
  123.  
  124.         private void menuStrip1_ItemClicked_2(object sender, ToolStripItemClickedEventArgs e)
  125.         {
  126.  
  127.         }
  128.  
  129.         private void textBox2_TextChanged(object sender, EventArgs e)
  130.         {
  131.  
  132.         }
  133.  
  134.         private void jjToolStripMenuItem_Click(object sender, EventArgs e)
  135.         {
  136.  
  137.         }
  138.  
  139.         private void toolStripMenuItem1_Click(object sender, EventArgs e)
  140.         {
  141.  
  142.         }
  143.  
  144.         private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
  145.         {
  146.  
  147.         }
  148.  
  149.         private void button6_Click(object sender, EventArgs e)
  150.         {
  151.             DateTime dateTime1 = monthCalendar1.SelectionStart;
  152.             textBox8.Text = dateTime1.ToShortDateString();
  153.         }
  154.  
  155.         private void button7_Click(object sender, EventArgs e)
  156.         {
  157.             int numOfDays = monthCalendar1.SelectionStart.DayOfYear - monthCalendar1.SelectionEnd.DayOfYear;
  158.             TimeSpan timeSpan;
  159.         }
  160.  
  161.         private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  162.         {
  163.             //System.Diagnostics.Process.Start(@"C:\");//If a path exists like this it will go look for it in the windows explorer
  164.             //What does the @ do?
  165.             //It makes using / and all the characters that need escape characters
  166.             //easier because I don't have to put escape characters when I put @
  167.            
  168.             //If I do it like this : System.Diagnostics.Process.Start("https:...etc")
  169.             //It'll open a webpage
  170.  
  171.             System.Diagnostics.Process.Start(@"C:\Users\shado\Pictures\Backgrounds\Dark Path.jpg");
  172.         }
  173.  
  174.         private void button8_Click(object sender, EventArgs e)
  175.         {
  176.            // MessageBox.Show("The message itself", "The title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Exclamation);
  177.             MessageBox.Show("The message itself", "The title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Exclamation);
  178.             DialogResult result= MessageBox.Show("The message itself", "The title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Exclamation);
  179.             if (result == DialogResult.Abort)
  180.                 MessageBox.Show("You've selected Abort");
  181.             if (result == DialogResult.Retry)
  182.                 MessageBox.Show("You've selected Retry");
  183.             if (result == DialogResult.Ignore)
  184.                 MessageBox.Show("You've selected Ignore");
  185.         }
  186.     }
  187. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement