Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.67 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 View
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.             listBox1.Items.Add("Run");
  19.  
  20.             listBox1.Items.Add("Swimming");
  21.  
  22.             listBox1.Items.Add("Barbell");
  23.             dataGridView1.Rows.Add();
  24.  
  25.            /* dataGridView1.Rows[0].Cells[0].Value = "Run";
  26.  
  27.             dataGridView1.Rows[0].Cells[1].Value = 6;
  28.  
  29.             dataGridView1.Rows[0].Cells[2].Value = 8;
  30.  
  31.             dataGridView1.Rows.Add();
  32.  
  33.             dataGridView1.Rows[1].Cells[0].Value = "Swimming";
  34.  
  35.             dataGridView1.Rows[1].Cells[1].Value = 9;
  36.  
  37.             dataGridView1.Rows[1].Cells[2].Value = "butterfly";
  38.  
  39.             dataGridView1.Rows.Add();
  40.  
  41.             dataGridView1.Rows[2].Cells[0].Value = "Barbel";
  42.  
  43.             dataGridView1.Rows[2].Cells[1].Value = 10;
  44.  
  45.             dataGridView1.Rows[2].Cells[2].Value = 6;
  46.             */
  47.         }
  48.  
  49.      
  50.         private void Form1_Load(object sender, EventArgs e)
  51.         {
  52.             Refresh();
  53.         }
  54.  
  55.         private void button2_Click(object sender, EventArgs e)
  56.         {
  57.             int i = dataGridView1.SelectedCells[0].RowIndex;
  58.  
  59.             dataGridView1.Rows.RemoveAt(i);
  60.         }
  61.  
  62.         private void button1_Click(object sender, EventArgs e)
  63.         {
  64.             AddForm f = new AddForm();
  65.            // this.Hide();
  66.             f.Show();
  67.            
  68.  
  69.         }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement