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


C# ColorPicker.Show方法代码示例

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


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

示例1: btnClick

        void btnClick(object sender, EventArgs e)
        {
            if (dap != null || de != null)
            {
                if (sender == btnFill)
                {
                    Point pt = new Point(btnFill.Bounds.Left, btnFill.Bounds.Bottom);
                    pt = btnFill.Owner.PointToScreen(pt);
                    ColorPicker f = new ColorPicker(pt.X, pt.Y, true);
                    f.ColorSelected += delegate(object sender2, EventArgs ea)
                    {
                        btnFill.Color = f.SelectedColor;
                        if (de != null && de.HsmState == DHsmState.Select)
                            UpdateSelectedFigures(btnFill);
                        else
                            dap.Fill = WFHelper.MakeColor(btnFill.Color);
                    };
                    f.Show();
                }
                else if (sender == btnStroke)
                {
                    Point pt = new Point(btnStroke.Bounds.Left, btnStroke.Bounds.Bottom);
                    pt = btnStroke.Owner.PointToScreen(pt);
                    ColorPicker f = new ColorPicker(pt.X, pt.Y, false);
                    f.ColorSelected += delegate(object sender2, EventArgs ea)
                    {
                        btnStroke.Color = f.SelectedColor;
                        if (de != null && de.HsmState == DHsmState.Select)
                            UpdateSelectedFigures(btnStroke);
                        else
                            dap.Stroke = WFHelper.MakeColor(btnStroke.Color);

                    };
                    f.Show();
                }
                else if (sender == btnFontName)
                {
                    Point pt = new Point(btnFontName.Bounds.Left, btnFontName.Bounds.Bottom);
                    pt = btnFontName.Owner.PointToScreen(pt);
                    FontNamePicker f = new FontNamePicker(pt.X, pt.Y, btnFontName.Value);
                    f.FontNameSelected += delegate(object sender2, EventArgs ea)
                    {
                        btnFontName.Value = f.SelectedFontName;
                        if (de != null && de.HsmState == DHsmState.Select)
                            UpdateSelectedFigures(btnFontName);
                        else
                            dap.FontName = btnFontName.Value;

                    };
                    f.Show();
                }
                else if (sender == btnBold)
                {
                    if (de != null && de.HsmState == DHsmState.Select)
                        UpdateSelectedFigures(btnBold);
                    else
                        dap.Bold = btnBold.Checked;
                }
                else if (sender == btnItalic)
                {
                    if (de != null && de.HsmState == DHsmState.Select)
                        UpdateSelectedFigures(btnItalic);
                    else
                        dap.Italics = btnItalic.Checked;
                }
                else if (sender == btnUnderline)
                {
                    if (de != null && de.HsmState == DHsmState.Select)
                        UpdateSelectedFigures(btnUnderline);
                    else
                        dap.Underline = btnUnderline.Checked;
                }
                else if (sender == btnStrikethrough)
                {
                    if (de != null && de.HsmState == DHsmState.Select)
                        UpdateSelectedFigures(btnStrikethrough);
                    else
                        dap.Strikethrough = btnStrikethrough.Checked;
                }
            }
        }
开发者ID:djpnewton,项目名称:ddraw,代码行数:81,代码来源:ToolStripState.cs

示例2: btnSwapColor_MouseDown

 /// <summary>
 /// 交换按钮颜色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSwapColor_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)// 选取颜色
     {
         Button btn = sender as Button;
         ColorPicker colorPicker = new ColorPicker(btn);
         colorPicker.SelectedColorChanged += new EventHandler((object_sender, EventArgs_e) =>
         {
             btn.BackColor = (Color)object_sender;
             colorPicker.Dispose();
             this.Activate();// 使焦点回到对话框上
         });
         colorPicker.Show(btn);
     }
     else// 交换颜色
     {
         Button btn = sender as Button;
         Color temp = btn.BackColor;
         btn.BackColor = btn1stColor.BackColor;
         btn1stColor.BackColor = temp;
     }
 }
开发者ID:h82258652,项目名称:YDWE,代码行数:27,代码来源:EditDialogBox.cs

示例3: btnSelectColor_Click

 /// <summary>
 /// 选择颜色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSelectColor_Click(object sender, EventArgs e)
 {
     Button btn = sender as Button;
     ColorPicker colorPicker = new ColorPicker(btn);
     colorPicker.SelectedColorChanged += new EventHandler((object_sender, EventArgs_e) =>
     {
         btn.BackColor = (Color)object_sender;
         colorPicker.Dispose();
         this.Activate();// 使焦点回到对话框上
     });
     colorPicker.Show(btn);
 }
开发者ID:h82258652,项目名称:YDWE,代码行数:17,代码来源:EditDialogBox.cs

示例4: Button_ColorPicker_Click

        ///////截图结束////////

        //取色

        private void Button_ColorPicker_Click(object sender, RoutedEventArgs e)
        {
            ColorPicker JTCol = new ColorPicker();
            JTCol.Show();
        }
开发者ID:Camixxx,项目名称:DesktopAssistant,代码行数:9,代码来源:MainWindow.xaml.cs

示例5: colorPicker

 private void colorPicker(object sender, EventArgs eventArgs)
 {
     _colorPicker = new ColorPicker();
     _colorPicker.Show();
 }
开发者ID:caschw,项目名称:ScrumTimer,代码行数:5,代码来源:App.xaml.cs

示例6: btnColor_Click

 private void btnColor_Click(object sender, EventArgs e)
 {
     Point pt = PointToScreen(new Point(btnColor.Left, btnColor.Bottom));
     ColorPicker f = new ColorPicker(pt.X, pt.Y, false);
     f.ColorSelected += delegate(object sender2, EventArgs ea)
     {
         panel1.BackColor = ((ColorPicker)sender2).SelectedColor;
     };
     f.Show();
 }
开发者ID:djpnewton,项目名称:ddraw,代码行数:10,代码来源:BackgroundForm.cs


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