Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. private void Form3_Load(object sender, EventArgs e)
  2. {
  3. for (int i = 1; i <= 5; i++)
  4. {
  5. //Lisätään palvelut Comboboxiin 1
  6. comboBox1.Items.Add(Form1.PalvelutTaulu[i]);
  7. }
  8. //Lisätään viikonpäivät Comboboxiin 2
  9. comboBox2.Items.Add("Maanantai");
  10. comboBox2.Items.Add("Tiistai");
  11. comboBox2.Items.Add("Keskiviikko");
  12. comboBox2.Items.Add("Torstai");
  13. comboBox2.Items.Add("Perjantai");
  14. comboBox2.Items.Add("Lauantai");
  15. comboBox2.Items.Add("Sunnuntai");
  16.  
  17. dataGridView1.RowCount = 6;
  18. dataGridView1.ColumnCount = 8;
  19. dataGridView1.Rows[0].Cells[1].Value = "Maanantai";
  20. dataGridView1.Rows[0].Cells[2].Value = "Tiistai";
  21. dataGridView1.Rows[0].Cells[3].Value = "Keskiviikko";
  22. dataGridView1.Rows[0].Cells[4].Value = "Torstai";
  23. dataGridView1.Rows[0].Cells[5].Value = "Perjantai";
  24. dataGridView1.Rows[0].Cells[6].Value = "Lauantai";
  25. dataGridView1.Rows[0].Cells[7].Value = "Sunnuntai";
  26.  
  27. dataGridView1.Rows[1].Cells[0].Value = Form1.PalvelutTaulu[1];
  28. dataGridView1.Rows[2].Cells[0].Value = Form1.PalvelutTaulu[2];
  29. dataGridView1.Rows[3].Cells[0].Value = Form1.PalvelutTaulu[3];
  30. dataGridView1.Rows[4].Cells[0].Value = Form1.PalvelutTaulu[4];
  31. dataGridView1.Rows[5].Cells[0].Value = Form1.PalvelutTaulu[5];
  32.  
  33.  
  34. for (int i = 1; i <= 5; i++)
  35. {
  36. //Lisätään palvelut Comboboxiin 3
  37. comboBox3.Items.Add(Form1.PalvelutTaulu[i]);
  38. }
  39. //Lisätään viikonpäivät Comboboxiin 4
  40. comboBox4.Items.Add("Maanantai");
  41. comboBox4.Items.Add("Tiistai");
  42. comboBox4.Items.Add("Keskiviikko");
  43. comboBox4.Items.Add("Torstai");
  44. comboBox4.Items.Add("Perjantai");
  45. comboBox4.Items.Add("Lauantai");
  46. comboBox4.Items.Add("Sunnuntai");
  47.  
  48. dataGridView1.RowCount = 6;
  49. dataGridView1.ColumnCount = 8;
  50. dataGridView1.Rows[0].Cells[1].Value = "Maanantai";
  51. dataGridView1.Rows[0].Cells[2].Value = "Tiistai";
  52. dataGridView1.Rows[0].Cells[3].Value = "Keskiviikko";
  53. dataGridView1.Rows[0].Cells[4].Value = "Torstai";
  54. dataGridView1.Rows[0].Cells[5].Value = "Perjantai";
  55. dataGridView1.Rows[0].Cells[6].Value = "Lauantai";
  56. dataGridView1.Rows[0].Cells[7].Value = "Sunnuntai";
  57.  
  58. dataGridView1.Rows[1].Cells[0].Value = Form1.PalvelutTaulu[1];
  59. dataGridView1.Rows[2].Cells[0].Value = Form1.PalvelutTaulu[2];
  60. dataGridView1.Rows[3].Cells[0].Value = Form1.PalvelutTaulu[3];
  61. dataGridView1.Rows[4].Cells[0].Value = Form1.PalvelutTaulu[4];
  62. dataGridView1.Rows[5].Cells[0].Value = Form1.PalvelutTaulu[5];
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement