本文整理汇总了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;
}
}
}
示例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;
}
}
示例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);
}
示例4: Button_ColorPicker_Click
///////截图结束////////
//取色
private void Button_ColorPicker_Click(object sender, RoutedEventArgs e)
{
ColorPicker JTCol = new ColorPicker();
JTCol.Show();
}
示例5: colorPicker
private void colorPicker(object sender, EventArgs eventArgs)
{
_colorPicker = new ColorPicker();
_colorPicker.Show();
}
示例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();
}