示例#1
0
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            OutlookBar outlookBar = new OutlookBar();

            outlookBar.Location    = new Point(0, 0);
            outlookBar.Size        = new Size(150, this.ClientSize.Height);
            outlookBar.BorderStyle = BorderStyle.FixedSingle;
            Controls.Add(outlookBar);
            outlookBar.Initialize();

            IconPanel iconPanel1 = new IconPanel();
            IconPanel iconPanel2 = new IconPanel();
            IconPanel iconPanel3 = new IconPanel();

            outlookBar.AddBand("Outlook Shortcuts", iconPanel1);
            outlookBar.AddBand("My Shortcuts", iconPanel2);
            outlookBar.AddBand("Other Shortcuts", iconPanel3);

            iconPanel1.AddIcon("Outlook Today", Image.FromFile("img1.ico"), new EventHandler(PanelEvent));
            iconPanel1.AddIcon("Calendar", Image.FromFile("img2.ico"), new EventHandler(PanelEvent));
            iconPanel1.AddIcon("Contacts", Image.FromFile("img3.ico"), new EventHandler(PanelEvent));
            iconPanel1.AddIcon("Tasks", Image.FromFile("img4.ico"), new EventHandler(PanelEvent));
            outlookBar.SelectBand(0);
        }
示例#2
0
        public void CreateMenu()
        {
            IconPanel iconPanel1 = new IconPanel();
            IconPanel iconPanel2 = new IconPanel();
            IconPanel iconPanel3 = new IconPanel();

            outlookBar1.DelAllBand();
            outlookBar1.AddBand(imageList1.Images[0], "Outlook Shortcuts", iconPanel1);
            outlookBar1.AddBand("My Shortcuts", iconPanel2);
            outlookBar1.AddBand("Other Shortcuts", iconPanel3);

            iconPanel1.AddIcon("Outlook Today", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel1.AddIcon("Calendar", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel1.AddIcon("Contacts", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel1.AddIcon("Tasks", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);

            iconPanel2.AddIcon("Calendar", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel2.AddIcon("Outlook Today", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel2.AddIcon("Contacts", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel2.AddIcon("Tasks", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);

            iconPanel3.AddIcon("Calendar", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel3.AddIcon("Outlook Today", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel3.AddIcon("Tasks", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
            iconPanel3.AddIcon("Contacts", imageList1.Images[1], new EventHandler(PanelEvent), outlookBar1.ButtonHeight);
        }
示例#3
0
        public PanelIcon(IconPanel parent, Image image, int index, EventHandler onClickEvent, int Height)
        {
            this.index     = index;
            this.iconPanel = parent;
            Image          = image;
            Visible        = true;
            Location       = new Point(iconPanel.outlookBar.Size.Width / 2 - image.Size.Width / 2,
                                       iconPanel.Margin + index * iconPanel.IconSpacing + Height);
            Size   = image.Size;
            Click += onClickEvent;
            Tag    = this;

            MouseEnter += new EventHandler(OnMouseEnter);
            MouseLeave += new EventHandler(OnMouseLeave);
            MouseMove  += new MouseEventHandler(OnMouseMove);

            bckgColor  = iconPanel.BackColor;
            mouseEnter = false;
        }