/// <summary> /// Controls, sub control initializer, private void that handles the control initialization. /// </summary> private void InitControls() { //value box settings; txtValue = new Label(); this.txtValue.BackColor = System.Drawing.Color.Gray; this.txtValue.Font = new System.Drawing.Font("Arial", 12, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); this.txtValue.Height = this.txtValue.Font.Height + 4; this.txtValue.ForeColor = System.Drawing.Color.White; this.txtValue.Location = new System.Drawing.Point(0, 0); this.txtValue.TextAlign = ContentAlignment.MiddleLeft; this.txtValue.Click += new EventHandler(ToggleTreeView); _GISAFunction = "Titulo"; //select button settings btnNext = new Button(); btnPrevious = new Button(); btnNext.FlatStyle = FlatStyle.Flat; btnNext.ForeColor = System.Drawing.Color.White; btnNext.BackColor = System.Drawing.Color.Gray; btnNext.Click += new EventHandler(NextTreeItem); btnNext.Text = ">"; btnPrevious.FlatStyle = FlatStyle.Flat; btnPrevious.ForeColor = System.Drawing.Color.White; btnPrevious.BackColor = System.Drawing.Color.Gray; btnPrevious.Click += new EventHandler(PreviousTreeItem); btnPrevious.Text = "<"; treeView = new TreeView(); //treeView.BorderStyle = BorderStyle.FixedSingle; treeView.Visible = true; treeView.AfterSelect += new TreeViewEventHandler(TreeViewNodeSelect); treeView.Click += new EventHandler(TreeViewNodeDoubleClickSelect); treeView.DoubleClick += new EventHandler(TreeViewNodeDoubleClickSelect); treeView.MouseMove += new MouseEventHandler(TreeViewMouseMoveEventHandler); treeView.Leave += new EventHandler(TreeViewLeave); //treeView.Size = new Size(tvMinWidth,tvMinHeight); treeView.Dock = System.Windows.Forms.DockStyle.Fill; treeView.HideSelection = false; treeLabel = new LabelEx(); treeLabel.Size = new Size(16, 16); treeLabel.BackColor = Color.Transparent; treeView.Controls.Add(treeLabel); panel = new Panel(); panel.BorderStyle = BorderStyle.FixedSingle; panel.Visible = false; panel.Size = new Size(tvMinWidth, tvMinHeight); panel.Controls.Add(treeView); SetHotSpot(); this.BackColor = System.Drawing.Color.Gray; this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); }
/// <summary> /// Controls, sub control initializer, private void that handles the control initialization. /// </summary> private void InitControls() { //value box settings; txtValue = new Label(); this.txtValue.BackColor = System.Drawing.Color.Gray; this.txtValue.Font = new System.Drawing.Font("Arial", 12, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); this.txtValue.Height = this.txtValue.Font.Height + 4; this.txtValue.ForeColor = System.Drawing.Color.White; this.txtValue.Location = new System.Drawing.Point(0, 0); this.txtValue.TextAlign = ContentAlignment.MiddleLeft; this.txtValue.Click += new EventHandler(ToggleTreeView); _GISAFunction = "Titulo"; //select button settings btnNext = new Button(); btnPrevious = new Button(); btnNext.FlatStyle = FlatStyle.Flat; btnNext.ForeColor = System.Drawing.Color.White; btnNext.BackColor = System.Drawing.Color.Gray; btnNext.Click += new EventHandler(NextTreeItem); btnNext.Text=">"; btnPrevious.FlatStyle = FlatStyle.Flat; btnPrevious.ForeColor = System.Drawing.Color.White; btnPrevious.BackColor = System.Drawing.Color.Gray; btnPrevious.Click += new EventHandler(PreviousTreeItem); btnPrevious.Text="<"; treeView = new TreeView(); //treeView.BorderStyle = BorderStyle.FixedSingle; treeView.Visible = true; treeView.AfterSelect += new TreeViewEventHandler(TreeViewNodeSelect); treeView.Click += new EventHandler(TreeViewNodeDoubleClickSelect); treeView.DoubleClick += new EventHandler(TreeViewNodeDoubleClickSelect); treeView.MouseMove += new MouseEventHandler(TreeViewMouseMoveEventHandler); treeView.Leave += new EventHandler(TreeViewLeave); //treeView.Size = new Size(tvMinWidth,tvMinHeight); treeView.Dock = System.Windows.Forms.DockStyle.Fill; treeView.HideSelection = false; treeLabel = new LabelEx(); treeLabel.Size = new Size(16,16); treeLabel.BackColor = Color.Transparent; treeView.Controls.Add(treeLabel); panel = new Panel(); panel.BorderStyle = BorderStyle.FixedSingle; panel.Visible = false; panel.Size = new Size(tvMinWidth, tvMinHeight); panel.Controls.Add(treeView); SetHotSpot(); this.BackColor = System.Drawing.Color.Gray; this.SetStyle(ControlStyles.DoubleBuffer,true); this.SetStyle(ControlStyles.ResizeRedraw,true); }