public dlgSelectTV(CASTreeViewCommon aTV) { // // Required for Windows Form Designer support // InitializeComponent(); _cmdCancel.TabStop = false; mPCLoadingItem = PlaceCode.Empty; mSelectedNode = null; pIsLoadByObj = true; mTV = aTV; mTV.Dock = DockStyle.Fill; mTV.AddMenuCommand(eCommand.Choice); mTV.Parent = this; //this.Controls.Add(mTV); mTV.BringToFront(); _cmdCancel.Click += new EventHandler (DoCommandCancel); this.Load += new EventHandler (OnDlgLoad); this.Closed += new EventHandler (OnDlgClosed); }
/// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { mSelectedNode = null; mTV = null; if(components != null) { components.Dispose(); } } base.Dispose( disposing ); }
/// <summary> /// Добавляем в ноды как хотим /// </summary> /// <param name="aNode"></param> public void AddTreeView(CASTreeViewCommon aView) { if (aView != null) { tv=(CASTreeViewCommon)aView.Clone(); tv.Refresh(); } }
public CASSparrow(bool aIsDataGridTextBox, int aQntParentsView) { mPC = PlaceCode.Empty; mTreeViewHeight = 100; pIsMayBeWithoutRefbook = false; pDownSelectIfNotFound = true; pIsExpandLevelWhenLoad = false; mIsTVVisable = false; SuspendLayout(); mQntParentsView = aQntParentsView; if (mQntParentsView == 0) { mLblParents = null; } else { mLblParents = new Label(); mLblParents.Size = new System.Drawing.Size(60, 22); mLblParents.TextAlign = ContentAlignment.MiddleRight; this.Controls.Add(mLblParents); } if (aIsDataGridTextBox) txt = new DataGridTextBox(); else txt = new TextBox(); txt.Name = "txt"; txt.Size = new System.Drawing.Size(160, 22); txt.TabIndex = 0; txt.Text = ""; //txt.AutoSize=true; txt.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown); txt.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.OnKeyPress); txt.TextChanged += new EventHandler(OnTextChanged); this.Controls.Add(txt); tv = new CASTreeViewCommon(); tv.Font=this.Font; tv.ClearMenuCommand(); //удаляем всё меню ! tv.AddMenuCommand(eCommand.Choice); //разрешаем только выбирать ! tv.Visible = mIsTVVisable; this.ResumeLayout(false); this.Layout +=new LayoutEventHandler(OnControlLayout); // This call is required by the Windows.Forms Form Designer. InitializeComponent(); OnResize(EventArgs.Empty); }