I have some strange problem.

This prbolem is occurred when I click on Maximize and restore buttons.
If I click on Maximize button, form is maximized, If I click on restore buttom Form_resize event is invoking continuously and it is going into forever loop.

Here by I am givng sample code

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Resizing
{
    public partial class Form1 : Form
    {
        private int m_lWidth=850;
        private bool m_bTemp = false;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            m_bTemp = true;
            this.Width = 730;
            
        }

        private void Form1_Resize(object sender, EventArgs e)
        {
            if (this.WindowState != FormWindowState.Minimized)
            {
                if (!m_bTemp)
                {
                    if (m_lWidth > this.Width && this.WindowState != FormWindowState.Maximized)
                        this.Width = m_lWidth;
                }
                m_bTemp = false;
            }
        }
    }
}

Here I set minimum size as (730/540)
If i click on button I set from width as 730. If I maximixe and resotre again I am checking Form width. If form width is less than 850 I am setting from width as 850. then resize event is going into for ever loop.

Similar type condition is there in My application

regards
Ravi