Advertisement
Guest User

loop

a guest
Oct 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 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 loopingArray
  12. {
  13. public partial class Form1 : Form
  14. {
  15.  
  16. string Id;
  17. string rn;
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23. private void Form1_Load(object sender, EventArgs e)
  24. {
  25.  
  26. string[] mData = { "aku", "kita", "dia", "kami" };
  27.  
  28. List<string> listDAta = new List<string>();
  29. listDAta.AddRange(mData);
  30.  
  31. Console.WriteLine(listDAta);
  32.  
  33. foreach (string i in listDAta)
  34. {
  35.  
  36. if (i.Equals("aku"))
  37. {
  38.  
  39. textEdit1.Text = i;
  40. Id = i;
  41. }
  42. else if (i.Equals("kita"))
  43. {
  44. MessageBox.Show("kita");
  45.  
  46. rn = i;
  47. }
  48.  
  49. UpdateData(Id, rn);
  50. }
  51.  
  52.  
  53.  
  54. }
  55.  
  56. private void UpdateData(string Id, string rn)
  57. {
  58. //textEdit1.Text = Id;
  59. //textEdit2.Text = rn;
  60.  
  61.  
  62.  
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement