日期:2014-05-17 浏览次数:20718 次
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.SizeChanged += SizeChangedHandler;
f2.ShowDialog();
}
private void SizeChangedHandler(object sender, SizeChangedEventArgs e)
{
this.Size = e.Size;
}
}
}
using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
namespace Test
{
public partial class Form2 : Form
{
public delegate void AdjustSizeEventHandler(object sender, SizeChangedEventArgs e);
public event AdjustSizeEventHandler SizeChanged;
public Form2()
{
InitializeComponent();