Example #1
0
 void menuItemColor_Click(object sender, EventArgs e)
 {
     if (ColorDlg.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
     {
         this.SelectionColor = ColorDlg.Color;
     }
 }
 private void FontColorToolStripButton_Click(object sender, EventArgs e)
 {
     if (ColorDlg.ShowDialog(this) != DialogResult.Cancel)
     {
         rtb.SelectionColor = ColorDlg.Color;
         _modified          = true;
     }
 }
Example #3
0
        private void SetColor(Button outButton)
        {
            ColorDlg colDlg = new ColorDlg();

            if (DialogResult.OK == colDlg.ShowDlg(outButton.BackColor))
            {
                outButton.BackColor = colDlg.SelectedColor;
            }
        }
Example #4
0
        private void ColorSwatch_Click(object sender, EventArgs e)
        {
            if (ColorDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            SetSwatchColor();
            FireConfigurationChanged();
        }
Example #5
0
File: CColor.cs Project: Daoting/dt
        void OnShowDlg(object sender, TappedRoutedEventArgs e)
        {
            if (ReadOnlyBinding)
            {
                return;
            }

            if (_dlg != null && _dlg.IsOpened)
            {
                _dlg.BringToTop();
                return;
            }

            if (_dlg == null)
            {
                if (Kit.IsPhoneUI)
                {
                    _dlg = new ColorDlg {
                        Owner = this, Title = "选择颜色"
                    };
                }
                else
                {
                    _dlg = new ColorDlg
                    {
                        Owner           = this,
                        WinPlacement    = DlgPlacement.TargetBottomLeft,
                        PlacementTarget = _grid,
                        ClipElement     = _grid,
                        HideTitleBar    = true,
                        Resizeable      = false,
                        Height          = 300,
                        Width           = _grid.ActualWidth,
                    };
                }
                // 不向下层对话框传递Press事件
                _dlg.AllowRelayPress = false;
            }
            _dlg.Show();
        }