Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     ColorPickerDialog dlg = new ColorPickerDialog();
     //dlg.Color = Color.Azure;
     dlg.ShowDialog(this);
     pictureBox1.BackColor = dlg.Color;
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ColorPickerDialog dlg = new ColorPickerDialog();

            //dlg.Color = Color.Azure;
            dlg.ShowDialog(this);
            pictureBox1.BackColor = dlg.Color;
        }
		public void onClickColorPickerDialog(IMenuItem item) {
			//The color picker menu item as been clicked. Show 
			//a dialog using the custom ColorPickerDialog class.

			var prefs = PreferenceManager.GetDefaultSharedPreferences(this);
			//TODO: check with the value for color
			int initialValue = prefs.GetInt("color_2", Int32.Parse("FF000000", System.Globalization.NumberStyles.HexNumber));

			Console.WriteLine("mColorPicker", "initial value:" + initialValue);

			ColorPickerDialog colorDialog = new ColorPickerDialog(this, initialValue);

			colorDialog.setAlphaSliderVisible(true);
			colorDialog.SetTitle("Pick a Color!");

//			colorDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(Resource.String.dialog_ok), new DialogInterface.OnClickListener() {
//
//				public void onClick(DialogInterface dialog, int which) {
//					Toast.MakeText(this, "Selected Color: " + colorToHexString(colorDialog.getColor()), ToastLength.Long).Show();
//
//					//Save the value in our preferences.
//					ISharedPreferencesEditor editor = prefs.Edit();
//					editor.PutInt("color_2", colorDialog.getColor());
//					editor.Commit();
//				}
//			});
//
//			colorDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
//
//				public void onClick(DialogInterface dialog, int which) {
//					//Nothing to do here.
//				}
//			});

			colorDialog.Show();
		}
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            ColorPickerDialog dlg = new ColorPickerDialog();

            dlg.ShowDialog(this);
        }
Exemplo n.º 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     ColorPickerDialog dlg = new ColorPickerDialog();
     dlg.ShowDialog(this);
 }
Exemplo n.º 6
0
 private void btnKeyClr_Click(object sender, EventArgs e)
 {
     btnKeyClr.BackColor = m_clrKey;
     clrPicker = new ColorPickerDialog(m_nImageID, scaleX, scaleY);
     clrPicker.OKpushed += new EventHandler(CP_OKpushed);
     if (DialogResult.OK == clrPicker.ShowDialog())
     {
         mTM.ReleaseTexture(m_nImageID);
         m_nImageID = mTM.LoadTexture(m_strFileName, Color.FromArgb(m_clrKey.R, m_clrKey.G, m_clrKey.B).ToArgb());
         panel1.Invalidate();
     }
 }
Exemplo n.º 7
0
 private void BackColor_Click(object sender, RoutedEventArgs e)
 {
     ColorPickerDialog cpd = new ColorPickerDialog(((SolidColorBrush)Background).Color);
     if ((bool)cpd.ShowDialog())
     {
         this.Background = new SolidColorBrush(cpd.SelectedColor);
     }
 }
Exemplo n.º 8
0
 private void ForeColor_Click(object sender, RoutedEventArgs e)
 {
     ColorPickerDialog cpd = new ColorPickerDialog(((SolidColorBrush)Foreground).Color);
     if ((bool)cpd.ShowDialog())
     {
         Settings.Default.Foreground = new SolidColorBrush(cpd.SelectedColor);
         //this.Foreground = new SolidColorBrush(cpd.SelectedColor);
     }
 }