Beispiel #1
0
 /// <summary>
 /// Добавляем в ноды как хотим
 /// </summary>
 /// <param name="aNode"></param>
 public void AddTreeView(CASTreeViewBase aView)
 {
   if (aView != null)
   {
     tv = (CASTreeViewBase)aView.Clone();
     tv.Refresh();
   }
 }
Beispiel #2
0
    public CASSelectFromTV(bool aIsDataGridTextBox)
    {
      mPC = PlaceCode.Empty;
      mTreeViewHeight = 100;
      pIsMayBeWithoutRefbook = false;
      pDownSelectIfNotFound = true;
      pIsExpandLevelWhenLoad = false;
      mIsTVVisable = false;
      pItemTreeNodeTag = null;
      pIsCodeOnly = true;

      SuspendLayout();

      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 CASTreeViewBase();
      tv.Font = this.Font;
      tv.ContextMenu = new ContextMenu();
      tv.ContextMenu.MenuItems.Add(new MenuItem("Выбрать", new EventHandler(onSelectedItem), Shortcut.CtrlS));
      tv.Visible = mIsTVVisable;
      tv.onDoCommand += new EvH_CasTVCommand(OnTreeItemDoCommand);

      this.ResumeLayout(false);
      this.Layout += new LayoutEventHandler(OnControlLayout);

      // This call is required by the Windows.Forms Form Designer.
      InitializeComponent();

      //OnResize(EventArgs.Empty);
      //			this.ParentChanged += new EventHandler(CASSelectFromTV_ParentChanged);
    }