Exemple #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            int count = 0;

            Items = new Items();
            if (data != null)
            {
                PIDL pidl = (PIDL)data.Clone();
                while (!pidl.IsDesktop)
                {
                    Items.Add(new Item(pidl));
                    pidl = (PIDL)pidl.GetParentFolder().Clone();
                    count++;
                }
                pidl.DisplayName = "My Computer";
                Item item = Items.Add(new Item(pidl));
                item.Rectangle = new Rectangle(0, 3, 16, 16);
                item.X         = 0;
                item.Y         = 3;
                item.Hotspot   = new Rectangle(17, 3, 17, 16);
                pidl.Dispose();

                int index = sysimagelist.IconIndex(data.Pidl);
                e.Graphics.DrawImage(sysimagelist.Icon(index).ToBitmap(), new Rectangle(3, 3, 16, 16));
                DrawItems(e.Graphics);
            }

            Rectangle rect = ClientRectangle;

            rect.Width--;
            rect.Height--;
            e.Graphics.DrawRectangle(RectPen, rect);
            base.OnPaint(e);
        }
Exemple #2
0
 public void Open(PIDL pidl)
 {
     this.pidl = (PIDL)pidl.Clone();
     InitializeFolder();
 }