Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 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.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication2
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         public class anweisung
  20.         {
  21.             public string text = "";
  22.             public object[] refs;
  23.             public anweisung(string text)
  24.             {
  25.                 this.text = text;
  26.             }
  27.             public void setrefs(ref object[] child)
  28.             {
  29.                 foreach(object obj in child)
  30.                 {
  31.                     refs[refs.Length] = obj;
  32.                 }
  33.             }
  34.         }
  35.  
  36.         private void button2_Click(object sender, EventArgs e)
  37.         {
  38.             anweisung anweisung1 = new anweisung("anw1");
  39.             anweisung anweisung2 = new anweisung("anw2");
  40.             anweisung1.setrefs(ref anweisung2);
  41.             textBox1.Text = anweisung1.text;
  42.             textBox2.Text = anweisung1.refs[0]... // wie komme ich hier auf "text" von "anweisung2"?
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement