Exemplo n.º 1
0
        public void SetupMenuStrip()
        {
            MainMenuBarControl        = new ZinMenuBarControl();
            MainMenuBarControl.Width  = this.ClientSize.Width;
            MainMenuBarControl.Anchor = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);

            this.Controls.Add(MainMenuBarControl);
            ZinMenuButton ZMB  = new ZinMenuButton("Change Station", ButtonType.Main, MainMenuBarControl);
            ZinMenuButton ZMB2 = new ZinMenuButton("Exit", ButtonType.Secondary, MainMenuBarControl);

            ZinMenuBarControl.Items[0].Click += Menu_ChangeStation_Click;
            ZinMenuBarControl.Items[1].Click += (o, i) => { Close(); };

            MainMenuBarControl.BringToFront();
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="text"></param>
        /// <param name="type"></param>
        /// <param name="parent">The ZinMenuBarControl Parent of this Button</param>
        public ZinMenuButton(string text, ButtonType type, ZinMenuBarControl parent)
        {
            //
            // Create Button
            //

            if (type == ButtonType.Main)
            {
                CreateButtonMain(text);
            }
            else
            {
                CreateButtonOthers(text);
            }

            parent.Controls.Add(this);
            this.MouseDown += ZinMenuButton_MouseDown;

            ZinMenuBarControl.Items.Add(this);
        }