예제 #1
0
 public DataTipForm()
 {
     InitializeComponent();
     rowLayout = new AutoRowHeightLayout(Tree, Tree.RowHeight);
     Tree.Cursor = Cursors.Default;
     Tree.ShowLines = false;
     Tree.Expanded += Tree_SizeChanged;
     Tree.Collapsed += Tree_SizeChanged;
     DataTree.ValueChanged += Tree_SizeChanged;
 }
예제 #2
0
        public TreeViewAdv()
        {
            this.BackColor = SystemColors.Window;
            SetStyle(ControlStyles.AllPaintingInWmPaint
                     | ControlStyles.UserPaint
                     | ControlStyles.OptimizedDoubleBuffer
                     | ControlStyles.ResizeRedraw
                     | ControlStyles.Selectable
                     , true);

            _rowLayout         = new AutoRowHeightLayout(this, 0);
            _rowMap            = new List <TreeNodeAdv>();
            _selection         = new List <TreeNodeAdv>();
            _readonlySelection = new ReadOnlyCollection <TreeNodeAdv>(_selection);
            _columns           = new TreeColumnCollection(this);
            _toolTip           = new ToolTip {
                ShowAlways = true
            };

            //_measureContext = new DrawContext();
            //_measureContext.Font = Font; //au: will set in OnFontChanged
            //_measureContext.Graphics = Graphics.FromImage(new Bitmap(1, 1));
            _measureContext.Graphics = Graphics.FromHwndInternal(default);             //au