Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Session ses = new Session();
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Form faux = new Form();
- TextBox tex = new TextBox();
- tex.Text="0";
- faux.Controls.Add(tex);
- ses.controles.Add(tex);
- faux.Show();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- for (int i = 0; i < ses.controles.Count; i++)
- {
- ses.controles[i].Text = ses.controles[i].Text + "<X>";
- }
- }
- }
- public class Session
- {
- public List<Control> controles{get;set;}
- public Session()
- {
- controles = new List<Control>();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement