Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 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 WindowsFormsApp14
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22. string danie;
  23. danie = textBox1.Text;
  24. listBox1.Items.Add(danie);
  25.  
  26. }
  27.  
  28. private void button2_Click(object sender, EventArgs e)
  29. {
  30. string text, szczawiowa;
  31.  
  32. text = "Dziś polecamy ";
  33. foreach (string obiad in listBox1.Items)
  34. {
  35. if (text)
  36. {
  37. text += obiad;
  38. }
  39. }
  40.  
  41.  
  42.  
  43. MessageBox.Show(text);
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement