Exemple #1
0
        private void PopupBar(object sender, System.EventArgs e)
        {
            if (m_PopupFromCode == null)
            {
                CreatePopupMenu();
            }

            // Apply style
            DevComponents.DotNetBar.eDotNetBarStyle style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
            if (((DevComponents.Editors.ComboItem)cboStyle.SelectedItem).Text != "Office2003")
            {
                style = DevComponents.DotNetBar.eDotNetBarStyle.VS2005;
            }
            m_PopupFromCode.Style = style;

            // MUST register with the DotNetBar manager if popup does not belong to ContextMenus collection
            dotNetBarManager1.RegisterPopup(m_PopupFromCode);

            // Set the pop-up width, not required but this is how you would change the popup bar width
            // Popup bar height is calculated based on its inital width and nubmer of sub-items
            m_PopupFromCode.PopupWidth = 200;

            // Place the menu just below the button
            Control ctrl = sender as Control;
            Point   p    = this.PointToScreen(new Point(ctrl.Left, ctrl.Bottom));

            m_PopupFromCode.PopupBar(p);
        }
Exemple #2
0
        private void buttonX6_Click(object sender, EventArgs e)
        {
            if (m_PopupFromCode == null)
            {
                CreatePopupMenu();
            }
            // Apply style
            DevComponents.DotNetBar.eDotNetBarStyle style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;

            m_PopupFromCode.Style = style;

            // MUST ALWAYS register popup with DotNetBar Manager if popup does not belong to ContextMenus collection
            dotNetBarManager1.RegisterPopup(m_PopupFromCode);

            // Place the menu just below the button
            Control ctrl = sender as Control;
            Point   p    = this.PointToScreen(new Point(ctrl.Left, ctrl.Bottom));

            m_PopupFromCode.PopupMenu(p);
        }
Exemple #3
0
        private void PopupMenu(object sender, System.EventArgs e)
        {
            if (m_PopupFromCode == null)
            {
                CreatePopupMenu();
            }

            // Apply style
            DevComponents.DotNetBar.eDotNetBarStyle style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
            if (((DevComponents.Editors.ComboItem)cboStyle.SelectedItem).Text != "Office2003")
            {
                style = DevComponents.DotNetBar.eDotNetBarStyle.VS2005;
            }
            m_PopupFromCode.Style = style;

            // MUST ALWAYS register popup with DotNetBar Manager if popup does not belong to ContextMenus collection
            dotNetBarManager1.RegisterPopup(m_PopupFromCode);

            // Place the menu just below the button
            Control ctrl = sender as Control;
            Point   p    = this.PointToScreen(new Point(ctrl.Left, ctrl.Bottom));

            m_PopupFromCode.PopupMenu(p);
        }