Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            PropertyForm f = new PropertyForm();

            f.TopLevel = false;
            //f.Dock = DockStyle.Fill;
            panelCodeEditor.Controls.Add(f);
            f.Show();
        }
Example #2
0
        private PropertyForm createPropWindow(string filename, string tag)
        {
            if (panelCodeEditor.Controls.Count > 0)
            {
                foreach (PropertyForm p in panelCodeEditor.Controls)
                {
                    if (p.Tag.ToString() == tag)
                    {
                        p.BringToFront();
                        return(p);
                    }
                }
            }

            PropertyForm f = new PropertyForm();

            f.TopLevel      = false;
            f.Tag           = tag;
            f.StartPosition = FormStartPosition.Manual;
            //f.Dock = DockStyle.Fill;
            panelCodeEditor.Controls.Add(f);
            f.BringToFront();
            if (filename != "")
            {
                f.richXML.LoadFile(filename, RichTextBoxStreamType.PlainText);
                HighlightColors.HighlightRTF(f.richXML);
            }

            int pos = ((panelCodeEditor.Controls.Count - 1) * 30) % (panelCodeEditor.Width - f.Width) + 1;

            f.Location = new Point(pos, pos);
            f.Text     = tag;
            f.Show();

            return(f);
        }