"jj" <jj@hotmail.com> wrote in message
news:u$**************@TK2MSFTNGP10.phx.gbl...
I used the following code to trigger some actions when the form is
resized. It works fine ONLY when the form is restored or resized to smaller size.
My codes are not executed ( ibelieve...) when I try to maximize or resize it
to larger size.
It should work. Try this in a test project...
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication1
{
public class Form1 : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Name = "Form1";
this.Text = "Form1";
this.Resize += new System.EventHandler(this.Form1_Resize);
}
#endregion
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Resize(object sender, System.EventArgs e)
{
MessageBox.Show( "Resize" );
}
}
}
--
Regards,
Tim Haughton
Agitek
http://agitek.co.uk http://blogitek.com/timhaughton