Beispiel #1
0
        private void InitializeComponents()
        {
            this.Height = 34;
            this.Width  = 150;

            this.Navigation = new ExplorerNavigation();
            this.Address    = new BreadcrumbBar();

            this.Navigation.Anchor    = AnchorStyles.Left | AnchorStyles.Top;
            this.Navigation.BackColor = System.Drawing.Color.Transparent;
            this.Navigation.Location  = new System.Drawing.Point(0, 0);
            this.Navigation.Name      = "Navigation";
            this.Navigation.Invalidate();

            this.Navigation.Padding = new Padding(1, 3, 1, 3);
            this.Address.Padding    = new Padding(1, 3, 1, 3);
            this.Padding            = new Padding(1, 3, 1, 3);

            this.Address.Location = new Point(this.Navigation.Width + 1, 3);
            this.Address.Size     = new Size(this.Width - this.Navigation.Width - 2, 22);
            this.Address.Anchor   = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;

            BreadcrumbBarButton refresh = new BreadcrumbBarButton();

            refresh.Image  = Properties.Resources.refresh;
            refresh.Click += new EventHandler(OnRefreshClick);

            this.Address.Buttons.Add(refresh);

            this.Controls.Add(this.Address);
            this.Controls.Add(this.Navigation);

            OnDockOnGlassChanged(EventArgs.Empty);
        }
Beispiel #2
0
 public override void Add(Control value)
 {
     if (value is BreadcrumbBarButton)
     {
         BreadcrumbBarButton v = value as BreadcrumbBarButton;
         v.Height = 20;
         v.Width  = 24;
         v.Left   = this.Owner.Width - (v.Width * (buttons.Count + 1)) - 2;
         v.Anchor = AnchorStyles.Top | AnchorStyles.Right;
         v.Top    = 1;
         v.Parent = Owner as BreadcrumbBar;
         buttons.Add(v);
         Owner.Controls.Add(v);
     }
 }