示例#1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="properties"></param>
        /// <param name="title"></param>
        /// <param name="open"></param>
        public PropertiesForm(Form properties, string title, bool open)
        {
            Properties = (IGXPropertyPage)properties;
            InitializeComponent();
            Properties.Initialize();
            this.Icon           = System.Drawing.Icon.ExtractAssociatedIcon(GetType().Assembly.Location);
            this.OKBtn.Enabled  = !open;
            this.Text           = title;
            this.OKBtn.Text     = DialogResult.OK.ToString();
            this.CancelBtn.Text = DialogResult.Cancel.ToString();
            //Settings can be change if connection is open.
            int h = 0;

            while (properties.Controls.Count != 0)
            {
                Control ctr = properties.Controls[0];
                if (ctr is Panel)
                {
                    if (ctr.Enabled)
                    {
                        h += ctr.Height;
                    }
                    else
                    {
                        properties.Controls.RemoveAt(0);
                        continue;
                    }
                }
                ctr.Enabled = !open;
                FormPanel.Controls.Add(ctr);
            }
            this.LocationChanged      += new EventHandler(PropertiesForm_LocationChanged);
            properties.TopLevel        = false;
            properties.TopMost         = false;
            properties.FormBorderStyle = FormBorderStyle.None;
            this.Controls.Add(properties);
            if (h == 0)
            {
                h = properties.Height;
            }
            h += panel1.Height;
            //Set client size.
            this.ClientSize = new Size(properties.Width, h);
        }
示例#2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="properties"></param>
 /// <param name="title"></param>
 /// <param name="open"></param>
 public PropertiesForm(Form properties, string title, bool open)
 {
     Properties = (IGXPropertyPage)properties;
     InitializeComponent();
     Properties.Initialize();
     this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(GetType().Assembly.Location);
     this.OKBtn.Enabled = !open;
     this.Text = title;                                   
     this.OKBtn.Text = DialogResult.OK.ToString();
     this.CancelBtn.Text = DialogResult.Cancel.ToString();           
     //Settings can be change if connection is open.            
     int h = 0;
     while(properties.Controls.Count != 0)
     {
         Control ctr = properties.Controls[0];                
         if (ctr is Panel)
         {
             if (ctr.Enabled)
             {
                 h += ctr.Height;
             }
             else
             {
                 properties.Controls.RemoveAt(0);
                 continue;
             }
         }
         ctr.Enabled = !open;
         FormPanel.Controls.Add(ctr);
     }
     this.LocationChanged += new EventHandler(PropertiesForm_LocationChanged);
     properties.TopLevel = false;
     properties.TopMost = false;
     properties.FormBorderStyle = FormBorderStyle.None;            
     this.Controls.Add(properties);
     if (h == 0)
     {
         h = properties.Height;
     }
     h += panel1.Height;
     //Set client size.
     this.ClientSize = new Size(properties.Width, h);
 }