本文整理汇总了C#中System.Windows.Forms.ColorDialog.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# ColorDialog.Dispose方法的具体用法?C# ColorDialog.Dispose怎么用?C# ColorDialog.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ColorDialog
的用法示例。
在下文中一共展示了ColorDialog.Dispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: chooseVerticalLineColor
static void chooseVerticalLineColor(object sender, EventArgs e)
{
ColorDialog cd = new ColorDialog();
cd.Color = MouseLiner.Properties.Settings.Default.VerticalLineColor;
if(cd.ShowDialog() == DialogResult.OK) {
MouseLiner.Properties.Settings.Default.VerticalLineColor = cd.Color;
}
cd.Dispose();
}
示例2: button1_Click
private void button1_Click(object sender, EventArgs e)
{
var cd = new ColorDialog();
cd.Color = Properties.Settings.Default.BackgroundColor;
if (cd.ShowDialog() == DialogResult.OK)
colorPanel.BackColor = cd.Color;
cd.Dispose();
}
示例3: button3_Click
private void button3_Click(object sender, EventArgs e)
{
var cd = new ColorDialog { Color = backColor, AllowFullOpen = true, SolidColorOnly = false };
if (cd.ShowDialog(this) == DialogResult.OK)
{
backColor = cd.Color;
}
cd.Dispose();
}
示例4: AdjustedColorButton_Click
private void AdjustedColorButton_Click(object sender, EventArgs e)
{
ColorDialog ColorBox = new ColorDialog();
if (DialogResult.OK == ColorBox.ShowDialog(this))
{
graph.ChangeColor(StockFile.STOCKTYPE.ADJUSTED, ColorBox.Color);
this.AdjustedColorButton.BackColor = ColorBox.Color;
}
ColorBox.Dispose();
}
示例5: MenuPlayer
public MenuPlayer(int playerId)
{
Player.Id = playerId;
Player.Name = "Player " + playerId;
Player.Color = Settings.DEFAULT_PLAYER_COLOR[playerId];
this.Height = RowSpacing * 3;
var PlayerName = new TextBox() { Text = "Player " + playerId, Top = 0, Left = 0, Width = 75 };
var ColorButton = new Button() { Top = 0, Left = LeftSpacing, BackColor = Player.Color };
var LeftLabel = new Label() { Text = "Left key", Top = RowSpacing, Width = 75 };
var LeftButton = new Button() { Top = RowSpacing, Left = LeftSpacing };
var RightLabel = new Label() { Text = "Right key", Top = RowSpacing * 2, Width = 75 };
var RightButton = new Button() { Top = RowSpacing * 2, Left = LeftSpacing };
ColorButton.Click += (o, e) =>
{
var a = new ColorDialog();
if (a.ShowDialog() == DialogResult.OK)
{
Player.Color = a.Color;
ColorButton.BackColor = a.Color;
}
a.Dispose();
};
PlayerName.TextChanged += (o, e) =>
{
Player.Name = PlayerName.Text;
};
LeftButton.Click += (o, e) =>
{
LeftButton.KeyDown += LeftButton_KeyDown;
};
RightButton.Click += (o, e) =>
{
RightButton.KeyDown += RightButton_KeyDown;
};
Controls.Add(ColorButton);
Controls.Add(PlayerName);
Controls.Add(LeftLabel);
Controls.AddRange(new Control[]{
ColorButton,
PlayerName,
LeftLabel,
LeftButton,
RightLabel,
RightButton,
});
}
示例6: mnuFeather_Click
private void mnuFeather_Click(object sender, EventArgs e)
{
if (this.selectedImage == null)
return;
ColorDialog colorDialog = new ColorDialog();
DialogResult result = colorDialog.ShowDialog();
if (result == DialogResult.OK)
{
Effects.FeatherImage(this.SelectedImage, colorDialog.Color);
this.picBoxMain.Invalidate();
colorDialog.Dispose();
// Gargabge Collection
System.GC.Collect();
}
}
示例7: mnuLineColorCustom_Click
// Select a custom color through Color common dialog.
private void mnuLineColorCustom_Click(object sender, EventArgs e)
{
// Allocate color dialog.
ColorDialog dlgColor = new ColorDialog();
// Disable section to create a customized, user specified color - only select from existing palette displayed.
dlgColor.AllowFullOpen = false;
// Initialize Color dialog color to current line color set in the Scratch Pad.
dlgColor.Color = f_spScratchPad.CurrentLineColor;
// Display dialog & apply settings only if OK is selected to new color change -
if (dlgColor.ShowDialog() == DialogResult.OK)
f_spScratchPad.CurrentLineColor = dlgColor.Color;
// Dispose of Color dialog box.
dlgColor.Dispose();
}
示例8: ColorButton_Click
private void ColorButton_Click(Button button)
{
ColorDialog colorchooser = new ColorDialog();
colorchooser.FullOpen = true;
colorchooser.ShowHelp = true;
colorchooser.Color = button.BackColor;
if (colorchooser.ShowDialog() == DialogResult.OK)
{
button.BackColor = colorchooser.Color;
}
colorchooser.Dispose();
}
示例9: bColor_Click
private void bColor_Click(object sender, System.EventArgs e)
{
ColorDialog cd = new ColorDialog();
cd.AnyColor = true;
cd.FullOpen = true;
cd.CustomColors = RdlDesigner.GetCustomColors();
try
{
if (cd.ShowDialog() != DialogResult.OK)
return;
RdlDesigner.SetCustomColors(cd.CustomColors);
if (sender == this.bEndColor)
cbEndColor.Text = ColorTranslator.ToHtml(cd.Color);
else if (sender == this.bBackColor)
cbBackColor.Text = ColorTranslator.ToHtml(cd.Color);
}
finally
{
cd.Dispose();
}
return;
}
示例10: btn_backColor_Click
private void btn_backColor_Click(object sender, EventArgs e)
{
ColorDialog backcolordialog = new ColorDialog();
backcolordialog.AllowFullOpen = true;
backcolordialog.FullOpen = true;
backcolordialog.AnyColor = true;
backcolordialog.Color = rtb_thread_main.BackColor;
if (backcolordialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
rtb_thread_main.BackColor = Color.FromArgb(255, backcolordialog.Color.R, backcolordialog.Color.G, backcolordialog.Color.B);
if (!setFontDontSave)
{
FontSet.SaveUserFontBackColor(Color.FromArgb(255, backcolordialog.Color.R, backcolordialog.Color.G, backcolordialog.Color.B).Name);
}
}
backcolordialog.Dispose();
}
示例11: SetNoteColor
/** The Button event handler. Open a Color Chooser dialog, and set the
* button color to the color chosen.
*/
private void SetNoteColor(object obj, EventArgs args)
{
Button b = (Button) obj;
ColorDialog cd = new ColorDialog();
cd.Color = b.ForeColor;
if (cd.ShowDialog() == DialogResult.OK) {
if (b == shadeButton) {
shadeColor = cd.Color;
shadeButton.BackColor = shadeButton.ForeColor = cd.Color;
}
else if (b == shade2Button) {
shade2Color = cd.Color;
shade2Button.BackColor = shade2Button.ForeColor = cd.Color;
}
else {
int index = (int)b.Tag;
colors[index] = cd.Color;
b.BackColor = b.ForeColor = cd.Color;
}
}
cd.Dispose();
}
示例12: BackgroundColorButtonClick
private void BackgroundColorButtonClick(object sender, EventArgs e)
{
ColorDialog cd = new ColorDialog{Color = backgroundColorButton.BackColor};
cd.ShowDialog();
backgroundColorButton.BackColor = cd.Color;
cd.Dispose();
}
示例13: HorizontalZeroColorButtonClick
private void HorizontalZeroColorButtonClick(object sender, EventArgs e)
{
ColorDialog cd = new ColorDialog{Color = horizontalZeroColorButton.BackColor};
cd.ShowDialog();
horizontalZeroColorButton.BackColor = cd.Color;
cd.Dispose();
}
示例14: btnColorDialog_Click
private void btnColorDialog_Click(object sender, EventArgs e)
{
ColorDialog dialog = new ColorDialog();
dialog.Color = Color.FromArgb(trackBarRed.Value, trackBarGreen.Value, trackBarBlue.Value);
dialog.AnyColor = true;
dialog.FullOpen = true;
if (dialog.ShowDialog() == DialogResult.OK)
{
trackBarRed.Value = dialog.Color.R;
trackBarGreen.Value = dialog.Color.G;
trackBarBlue.Value = dialog.Color.B;
ColourSlidersUpdated();
UpdateNumberFromScrollBars();
}
dialog.Dispose();
}
示例15: contextMenuStrip1_ItemClicked
private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) {
if(e.ClickedItem == this.colorToolStripMenuItem) {
ColorDialog dialog = new ColorDialog();
if(this.richTextBox1.SelectionColor != Color.Empty) {
dialog.Color = this.richTextBox1.SelectionColor;
}
if(dialog.ShowDialog() == DialogResult.OK) {
this.richTextBox1.SelectionColor = dialog.Color;
}
dialog.Dispose();
}
else if(e.ClickedItem == this.defaultToolStripMenuItem) {
this.richTextBox1.SelectionColor = SystemColors.WindowText;
}
else if(e.ClickedItem == this.defaultFontToolStripMenuItem) {
this.richTextBox1.SelectionFont = this.richTextBox1.Font;
}
else if(e.ClickedItem == this.cutToolStripMenuItem) {
this.richTextBox1.Cut();
}
else if(e.ClickedItem == this.copyToolStripMenuItem) {
this.richTextBox1.Copy();
}
else if(e.ClickedItem == this.pasteToolStripMenuItem) {
this.richTextBox1.Paste();
}
else if(e.ClickedItem == this.deleteToolStripMenuItem) {
this.richTextBox1.SelectedText = string.Empty;
}
else if(e.ClickedItem == this.searchToolStripMenuItem) {
if(this.richTextBox1.CanUndo) {
this.FixCurrent();
}
this.CreateMemoList();
this.richTextBox1.Visible = false;
this.Refresh();
this.textBox1.Focus();
}
}