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


C# ColorDialog.Dispose方法代码示例

本文整理汇总了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();
 }
开发者ID:kobachi,项目名称:MouseLiner,代码行数:9,代码来源:Program.cs

示例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();
        }
开发者ID:oliverheilig,项目名称:LeafletPano,代码行数:9,代码来源:MainForm.cs

示例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();
 }
开发者ID:tdhieu,项目名称:iSpy,代码行数:9,代码来源:AddCommandButton.cs

示例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();
        }
开发者ID:Claith,项目名称:Stock-Analysis-Project,代码行数:11,代码来源:GraphControl.cs

示例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,
            });
        }
开发者ID:jakkes,项目名称:SnakeGame,代码行数:51,代码来源:MenuPlayer.cs

示例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();
            }
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:17,代码来源:NuGenScreenCap.cs

示例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();
        }
开发者ID:WesKam1,项目名称:Scratch-Pad-Desktop,代码行数:19,代码来源:MainForm.cs

示例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();
 }
开发者ID:ggmod,项目名称:WordSyntaxHighlighter,代码行数:12,代码来源:FrameStyleForm.cs

示例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;
        }
开发者ID:kunalpatwardhan,项目名称:My-FyiReporting,代码行数:24,代码来源:BackgroundCtl.cs

示例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();
        }
开发者ID:MaiReo,项目名称:SimpleRobotDemo,代码行数:18,代码来源:frm_NewThread.cs

示例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();
 }
开发者ID:BYVoid,项目名称:MidiToSheetMusic,代码行数:25,代码来源:NoteColorDialog.cs

示例12: BackgroundColorButtonClick

 private void BackgroundColorButtonClick(object sender, EventArgs e)
 {
     ColorDialog cd = new ColorDialog{Color = backgroundColorButton.BackColor};
     cd.ShowDialog();
     backgroundColorButton.BackColor = cd.Color;
     cd.Dispose();
 }
开发者ID:JurgenCox,项目名称:compbio-base,代码行数:7,代码来源:PlanePropertiesForm.cs

示例13: HorizontalZeroColorButtonClick

 private void HorizontalZeroColorButtonClick(object sender, EventArgs e)
 {
     ColorDialog cd = new ColorDialog{Color = horizontalZeroColorButton.BackColor};
     cd.ShowDialog();
     horizontalZeroColorButton.BackColor = cd.Color;
     cd.Dispose();
 }
开发者ID:JurgenCox,项目名称:compbio-base,代码行数:7,代码来源:PlanePropertiesForm.cs

示例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();
		}
开发者ID:Aquilon96,项目名称:ags,代码行数:16,代码来源:PaletteEditor.cs

示例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();
     }
 }
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:39,代码来源:MemoForm.cs


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