Advertisement
Tahevix

Tablica 2 Wymiarowa - YouTube

Aug 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 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 WindowsFormsApp8
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         public string[,] tablica2D { get; private set; }
  21.  
  22.         private void button1_Click(object sender, EventArgs e)
  23.         {
  24.             int x = Convert.ToInt32(textBox3.Text);
  25.             int y = Convert.ToInt32(textBox4.Text);
  26.  
  27.             tablica2D = new string[x, y];
  28.         }
  29.  
  30.         private void button2_Click(object sender, EventArgs e)
  31.         {
  32.             int x_ = Convert.ToInt32(textBox5.Text);
  33.             int y_ = Convert.ToInt32(textBox1.Text);
  34.  
  35.             string w = textBox2.Text;
  36.             tablica2D[x_, y_] = w;
  37.         }
  38.  
  39.         private void button3_Click(object sender, EventArgs e)
  40.         {
  41.             foreach(string element in tablica2D)
  42.             {
  43.                 listBox1.Items.Add(element);
  44.             }
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement