当前位置: 首页>>代码示例>>C#>>正文


C# ToolStrip.PointToClient方法代码示例

本文整理汇总了C#中System.Windows.Forms.ToolStrip.PointToClient方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStrip.PointToClient方法的具体用法?C# ToolStrip.PointToClient怎么用?C# ToolStrip.PointToClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ToolStrip的用法示例。


在下文中一共展示了ToolStrip.PointToClient方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderToolButtonBackground

        private void RenderToolButtonBackground(Graphics g,
                                                ToolStripButton button,
                                                ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (button.Enabled)
            {
                if (button.Checked)
                {
                    if (button.Pressed)
                        this.DrawGradientToolItem(g, button, _itemToolItemPressedColors);
                    else if (button.Selected)
                        this.DrawGradientToolItem(g, button, _itemToolItemCheckPressColors);
                    else
                        this.DrawGradientToolItem(g, button, _itemToolItemCheckedColors);
                }
                else
                {
                    if (button.Pressed)
                        this.DrawGradientToolItem(g, button, _itemToolItemPressedColors);
                    else if (button.Selected)
                        this.DrawGradientToolItem(g, button, _itemToolItemSelectedColors);
                }
            }
            else
            {
                if (button.Selected)
                {
                    // Get the mouse position in tool strip coordinates
                    Point mousePos = toolstrip.PointToClient(Control.MousePosition);

                    // If the mouse is not in the item area, then draw disabled
                    if (!button.Bounds.Contains(mousePos))
                        this.DrawGradientToolItem(g, button, _itemDisabledColors);
                }
            }
        }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:37,代码来源:Office2007Renderer.cs

示例2: RenderToolSplitButtonBackground

        private void RenderToolSplitButtonBackground(Graphics g,
                                                     ToolStripSplitButton splitButton,
                                                     ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (splitButton.Selected || splitButton.Pressed)
            {
                if (splitButton.Enabled)
                {
                    if (!splitButton.Pressed && splitButton.ButtonPressed)
                        this.DrawGradientToolSplitItem(g, splitButton,
                                                       _itemToolItemPressedColors,
                                                       _itemToolItemSelectedColors,
                                                       _itemContextItemEnabledColors);
                    else if (splitButton.Pressed && !splitButton.ButtonPressed)
                        this.DrawContextMenuHeader(g, splitButton);
                    else
                        this.DrawGradientToolSplitItem(g, splitButton,
                                                       _itemToolItemSelectedColors,
                                                       _itemToolItemSelectedColors,
                                                       _itemContextItemEnabledColors);
                }
                else
                {
                    // Get the mouse position in tool strip coordinates
                    Point mousePos = toolstrip.PointToClient(Control.MousePosition);

                    // If the mouse is not in the item area, then draw disabled
                    if (!splitButton.Bounds.Contains(mousePos))
                        this.DrawGradientToolItem(g, splitButton, _itemDisabledColors);
                }
            }
        }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:33,代码来源:Office2007Renderer.cs

示例3: RenderToolDropButtonBackground

        private void RenderToolDropButtonBackground(Graphics g,
                                                    ToolStripItem item, 
                                                    ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (item.Selected || item.Pressed)
            {
                if (item.Enabled)
                {
                    if (item.Pressed)
                        DrawContextMenuHeader(g, item);
                    else
                        DrawGradientToolItem(g, item, _itemToolItemSelectedColors);
                }
                else
                {
                    // Get the mouse position in tool strip coordinates
                    Point mousePos = toolstrip.PointToClient(Control.MousePosition);

                    // If the mouse is not in the item area, then draw disabled
                    if (!item.Bounds.Contains(mousePos))
                        DrawGradientToolItem(g, item, _itemDisabledColors);
                }
            }

        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:26,代码来源:Office2007LightRenderer.cs

示例4: RenderToolSplitButtonBackground

        private void RenderToolSplitButtonBackground(Graphics g,
                                                     ToolStripSplitButton splitButton,
                                                     ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (splitButton.Selected || splitButton.Pressed)
            {
                if (splitButton.Enabled)
                {
                    // Ensure we have cached the objects we need
                    UpdateCache();

                    if (!splitButton.Pressed && splitButton.ButtonPressed)
                        DrawGradientToolSplitItem(g, splitButton, _gradientPressed, _gradientPressed, _gradientPressed);
                    else if (splitButton.Pressed && !splitButton.ButtonPressed)
                        DrawContextMenuHeader(g, splitButton);
                    else
                        DrawGradientToolSplitItem(g, splitButton, _gradientTracking, _gradientTracking, _gradientTracking);
                }
                else
                {
                    // Get the mouse position in tool strip coordinates
                    Point mousePos = toolstrip.PointToClient(Control.MousePosition);

                    // If the mouse is not in the item area, then draw disabled
                    if (!splitButton.Bounds.Contains(mousePos))
                        DrawGradientToolItem(g, splitButton, _disabledGradientItem);
                }
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:30,代码来源:KryptonSparkleRenderer.cs

示例5: RenderToolDropButtonBackground

        private void RenderToolDropButtonBackground(Graphics g,
                                                    ToolStripItem item,
                                                    ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (item.Selected || item.Pressed)
            {
                if (item.Enabled)
                {
                    if (item.Pressed)
                        DrawContextMenuHeader(g, item);
                    else
                    {
                        // Ensure we have cached the objects we need
                        UpdateCache();

                        DrawGradientToolItem(g, item, _gradientTracking);
                    }
                }
                else
                {
                    // Get the mouse position in tool strip coordinates
                    Point mousePos = toolstrip.PointToClient(Control.MousePosition);

                    // If the mouse is not in the item area, then draw disabled
                    if (!item.Bounds.Contains(mousePos))
                        DrawGradientToolItem(g, item, _disabledItem);
                }
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:30,代码来源:KryptonOffice2013Renderer.cs

示例6: RenderToolButtonBackground

        private void RenderToolButtonBackground(Graphics g,
                                                ToolStripButton button,
                                                ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (button.Enabled)
            {
                // Ensure we have cached the objects we need
                UpdateCache();

                if (button.Checked)
                {
                    if (button.Pressed)
                        DrawGradientToolItem(g, button, _gradientPressed);
                    else if (button.Selected)
                        DrawGradientToolItem(g, button, _gradientCheckedTracking);
                    else
                        DrawGradientToolItem(g, button, _gradientChecked);
                }
                else
                {
                    if (button.Pressed)
                        DrawGradientToolItem(g, button, _gradientPressed);
                    else if (button.Selected)
                        DrawGradientToolItem(g, button, _gradientTracking);
                }
            }
            else
            {
                if (button.Selected)
                {
                    // Get the mouse position in tool strip coordinates
                    Point mousePos = toolstrip.PointToClient(Control.MousePosition);

                    // If the mouse is not in the item area, then draw disabled
                    if (!button.Bounds.Contains(mousePos))
                        DrawGradientToolItem(g, button, _disabledItem);
                }
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:40,代码来源:KryptonOffice2013Renderer.cs

示例7: getButtonState

        private ButtonSelectedState getButtonState(ToolStrip toolStrip, ToolStripItem item)
        {
            if (!item.Enabled)
                return ButtonSelectedState.Disabled;

            if (item is ToolStripButton)
            {
                ToolStripButton button = (ToolStripButton)item;
                if (button.Checked)
                    return ButtonSelectedState.Checked;
            }

            if (item.Pressed)
            {
                return ButtonSelectedState.Pressed;
            }
            else
            {
                Point cursorPos = toolStrip.PointToClient(Cursor.Position);
                if ((item.Visible) && (item.Bounds.Contains(cursorPos)))
                    return ButtonSelectedState.Focused;
                else
                    return ButtonSelectedState.None;
            }
        }
开发者ID:Egoily,项目名称:CSharp-EAlbum,代码行数:25,代码来源:FaceRender.cs


注:本文中的System.Windows.Forms.ToolStrip.PointToClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。