public interface IFormDataInterface
{
void SetData(String Data);
}
public partial class Form1 : Form, IFormDataInterface
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2(this as IFormDataInterface);
frm.Show();
}
public void SetData(String Data)
{
textBox1.Text = Data;
}
}
public partial class Form2 : Form
{
private IFormDataInterface frm = null;
public Form2(IFormDataInterface frm)
{
InitializeComponent();
this.frm = frm;
}
private void button1_Click(object sender, EventArgs e)
{
frm.SetData(textBox1.Text);
}
}
'c# > WinForm' 카테고리의 다른 글
| c# 콤보박스 특정 조건 배경에 색칠하기 (0) | 2018.09.27 |
|---|---|
| WinForm HorizontalScroll False 하는 방법..스크롤 이슈 (0) | 2018.09.18 |
| TableLayoutPanel 마우스 스크롤 (0) | 2018.09.07 |
| TableLayoutPanel SLOW 에서 FAST 하게 하는 코드 (0) | 2018.09.07 |
| WinForm Tab내에 새로운 Form 띄우기 (0) | 2018.09.06 |


