Exemplo n.º 1
0
        public RosterGanttControl()
        {
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.Selectable, true);

            //hScrollbar = new HScrollBar();
            hScrollbar = new MetroFramework.Controls.MetroScrollBar(MetroFramework.Controls.MetroScrollOrientation.Horizontal);
            hScrollbar.Style = MetroFramework.MetroColorStyle.Black;
            hScrollbar.SmallChange = halfHourWidth;
            hScrollbar.LargeChange = halfHourWidth * 2;
            hScrollbar.Dock = DockStyle.Bottom;
            hScrollbar.Visible = true;
            hScrollbar.Scroll += new ScrollEventHandler(hScrollbar_Scroll);

            //vScrollbar = new VScrollBar();
            vScrollbar = new MetroFramework.Controls.MetroScrollBar(MetroFramework.Controls.MetroScrollOrientation.Vertical);
            vScrollbar.SmallChange = 1;//rowHeight;
            vScrollbar.LargeChange = 2;// rowHeight * 2;
            vScrollbar.Dock = DockStyle.Right;
            vScrollbar.Visible = true;
            vScrollbar.Scroll += new ScrollEventHandler(vScrollbar_Scroll);

            AdjustScrollbar();

            hScrollbar.Value = 0;
            vScrollbar.Value = 0;

            this.Controls.Add(hScrollbar);
            this.Controls.Add(vScrollbar);

            drawTool = new DrawTool();
            drawTool.RosterGanttView = this;
            activeTool = drawTool;

            selectionTool = new SelectionTool();
            selectionTool.RosterGanttView = this;
            selectionTool.Complete += new EventHandler(selectionTool_Complete);

            editbox = new TextBox();
            editbox.Multiline = true;
            editbox.Visible = false;
            editbox.BorderStyle = BorderStyle.None;
            editbox.KeyUp += new KeyEventHandler(editbox_KeyUp);
            editbox.Margin = Padding.Empty;

            this.Controls.Add(editbox);

            lblTip = new Label();
            lblTip.Visible = false;
            lblTip.AutoSize = true;
            //lblTip.BackColor = System.Drawing.SystemColors.Window;
            lblTip.BackColor = Color.FromArgb(95, 0, 0, 0);//Roger
            lblTip.ForeColor = Color.FromArgb(255, 255, 255);
            lblTip.BorderStyle = System.Windows.Forms.BorderStyle.None;

            lblTip.MaximumSize = new System.Drawing.Size(200, 400);
            lblTip.MinimumSize = new System.Drawing.Size(100, 25);
            lblTip.Padding = new System.Windows.Forms.Padding(5);
            lblTip.Size = new System.Drawing.Size(100, 25);
            lblTip.Name = "label3";

            this.Controls.Add(lblTip);

            //this.renderer = new Office12Renderer();
            this.renderer = new MetroRenderer();
        }
Exemplo n.º 2
0
        public RosterGanttControl()
        {
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.Selectable, true);

            //hScrollbar = new HScrollBar();
            hScrollbar             = new MetroFramework.Controls.MetroScrollBar(MetroFramework.Controls.MetroScrollOrientation.Horizontal);
            hScrollbar.Style       = MetroFramework.MetroColorStyle.Black;
            hScrollbar.SmallChange = halfHourWidth;
            hScrollbar.LargeChange = halfHourWidth * 2;
            hScrollbar.Dock        = DockStyle.Bottom;
            hScrollbar.Visible     = true;
            hScrollbar.Scroll     += new ScrollEventHandler(hScrollbar_Scroll);

            //vScrollbar = new VScrollBar();
            vScrollbar             = new MetroFramework.Controls.MetroScrollBar(MetroFramework.Controls.MetroScrollOrientation.Vertical);
            vScrollbar.SmallChange = 1; //rowHeight;
            vScrollbar.LargeChange = 2; // rowHeight * 2;
            vScrollbar.Dock        = DockStyle.Right;
            vScrollbar.Visible     = true;
            vScrollbar.Scroll     += new ScrollEventHandler(vScrollbar_Scroll);

            AdjustScrollbar();

            hScrollbar.Value = 0;
            vScrollbar.Value = 0;

            this.Controls.Add(hScrollbar);
            this.Controls.Add(vScrollbar);

            drawTool = new DrawTool();
            drawTool.RosterGanttView = this;
            activeTool = drawTool;

            selectionTool = new SelectionTool();
            selectionTool.RosterGanttView = this;
            selectionTool.Complete       += new EventHandler(selectionTool_Complete);


            editbox             = new TextBox();
            editbox.Multiline   = true;
            editbox.Visible     = false;
            editbox.BorderStyle = BorderStyle.None;
            editbox.KeyUp      += new KeyEventHandler(editbox_KeyUp);
            editbox.Margin      = Padding.Empty;

            this.Controls.Add(editbox);

            lblTip          = new Label();
            lblTip.Visible  = false;
            lblTip.AutoSize = true;
            //lblTip.BackColor = System.Drawing.SystemColors.Window;
            lblTip.BackColor   = Color.FromArgb(95, 0, 0, 0);//Roger
            lblTip.ForeColor   = Color.FromArgb(255, 255, 255);
            lblTip.BorderStyle = System.Windows.Forms.BorderStyle.None;

            lblTip.MaximumSize = new System.Drawing.Size(200, 400);
            lblTip.MinimumSize = new System.Drawing.Size(100, 25);
            lblTip.Padding     = new System.Windows.Forms.Padding(5);
            lblTip.Size        = new System.Drawing.Size(100, 25);
            lblTip.Name        = "label3";

            this.Controls.Add(lblTip);

            //this.renderer = new Office12Renderer();
            this.renderer = new MetroRenderer();
        }