Ejemplo n.º 1
0
        /// <summary>
        /// 특정 컨트롤을 팝업 형식으로 화면에 띄울 수 있게 타겟을 지정한다.
        /// </summary>
        /// <param name="content"></param>
        public PopupWindow(System.Windows.Forms.Control content)
        {
            //Basic setup...
            this.Margin  = new System.Windows.Forms.Padding(0, 0, 0, 0);
            this.Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);

            //this.Renderer = new System.Windows.Forms.ToolStripProfessionalRenderer();

            this.AutoSize       = false;
            this.DoubleBuffered = true;
            this.ResizeRedraw   = true;
            this._content       = content;
            this._host          = new System.Windows.Forms.ToolStripControlHost(content);

            //Positioning and Sizing
            //this.MinimumSize = content.MinimumSize;
            this.MinimumSize = new System.Drawing.Size(0, 0);
            //this.MaximumSize = content.Size;
            this.MaximumSize = new System.Drawing.Size(0, 0);

            this.Size        = new System.Drawing.Size(content.Size.Width, content.Size.Height);
            content.Location = System.Drawing.Point.Empty;


            //Add the host to the list
            this.Items.Add(this._host);
            this.SetTopLevel(true);
        }
Ejemplo n.º 2
0
 public PopupWindow(System.Windows.Forms.Control content)
 {
     //Basic setup...
     this.AutoSize       = false;
     this.DoubleBuffered = true;
     this.ResizeRedraw   = true;
     this._content       = content;
     this._host          = new System.Windows.Forms.ToolStripControlHost(content);
     //Positioning and Sizing
     this.MinimumSize = content.MinimumSize;
     this.MaximumSize = content.Size;
     this.Size        = content.Size;
     content.Location = Point.Empty;
     //Add the host to the list
     this.Items.Add(this._host);
 }
Ejemplo n.º 3
0
        public void Show(Point screenLocation)
        {
            System.Windows.Forms.ToolStripControlHost host = new System.Windows.Forms.ToolStripControlHost(this);
            ToolStripDropDown = new System.Windows.Forms.ToolStripDropDown();
            ToolStripDropDown.Items.Clear();
            ToolStripDropDown.Items.Add(host);

            ToolStripDropDown.Padding = System.Windows.Forms.Padding.Empty;
            ToolStripDropDown.Margin = System.Windows.Forms.Padding.Empty;
            host.Padding = System.Windows.Forms.Padding.Empty;
            host.Margin = System.Windows.Forms.Padding.Empty;

            ToolStripDropDown.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(ToolStripDropDown_Closed);

            ToolStripDropDown.Show(screenLocation);
        }
Ejemplo n.º 4
0
        public PopUp(System.Windows.Forms.Control content)
        {
            this.AutoSize       = false;
            this.DoubleBuffered = true;
            this.ResizeRedraw   = true;
            this.BackColor      = content.BackColor;
            this._content       = content;

            this._host = new System.Windows.Forms.ToolStripControlHost(content);

            this.MinimumSize = content.MinimumSize;
            this.MaximumSize = content.Size;

            this.Size = content.Size;

            content.Location = System.Drawing.Point.Empty;

            this.Items.Add(this._host);
        }
Ejemplo n.º 5
0
        public ArrayEditor(AbstractObjectEditor Con)
            : base(null)
        {
            con                        = Con;
            split.Dock                 = System.Windows.Forms.DockStyle.Fill;
            split.Panel1MinSize        = 100;
            split.FixedPanel           = System.Windows.Forms.FixedPanel.Panel1;
            split.SplitterDistance     = 150;
            list                       = new ArrayListbox();
            list.Dock                  = System.Windows.Forms.DockStyle.Fill;
            list.SelectedIndexChanged += new EventHandler(list_SelectedIndexChanged);
            split.Panel1.Controls.Add(list);
            con.Control.Dock = System.Windows.Forms.DockStyle.Fill;
            split.Panel2.Controls.Add(con.Control);

            Con.DirtyChanged             += new EventHandler(Con_DirtyChanged);
            menuResizeTextbox             = new System.Windows.Forms.NumericUpDown();
            menuResize                    = new System.Windows.Forms.ToolStripMenuItem();
            menuResize.Text               = "更改最大值(&M)";
            menuResizeTextbox.Font        = split.Font;
            menuResizeTextbox.UpDownAlign = System.Windows.Forms.LeftRightAlignment.Left;
            menuResizeTextbox.BorderStyle = System.Windows.Forms.BorderStyle.None;
            menuResizeTextbox.Cursor      = System.Windows.Forms.Cursors.Default;
            var host = new System.Windows.Forms.ToolStripControlHost(menuResizeTextbox);

            menuResize.DropDownItems.Add(host);
            var dd = (menuResize.DropDown as System.Windows.Forms.ToolStripDropDownMenu);

            dd.ShowImageMargin = false;
            dd.BackColor       = System.Drawing.SystemColors.Window;

            this.list.ContextMenuStrip = new EditContextMenuStrip(this);
            this.list.ContextMenuStrip.Items.Add(new System.Windows.Forms.ToolStripSeparator());
            this.list.ContextMenuStrip.Items.Add(menuResize);
            this.list.ContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(ContextMenuStrip_Opening);

            menuResizeTextbox.ValueChanged += new EventHandler(menuResizeTextbox_ValueChanged);
        }