Hiển thị data từ class khác lên Form

Trần Thượng

Trứng gà
mình muốn hiển thị data từ class mình tạo lên Form nhưng khi chạy k đúng ( k hiển thị được),
Có ai biết cách giúp mình với nhé :)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TestClass
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
TestClass test = new TestClass();
test.ModifyText(textBox1);
}
}

public class TestClass
{
public void ModifyText(TextBox textBox)
{
textBox.Text = "New text";
}
}
}
 
Top