Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

color picker wpf

System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();
 if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
 {
      YourBtn.Background = new SolidColorBrush(Color.FromArgb(colorDialog.Color.A, colorDialog.Color.R, colorDialog.Color.G, colorDialog.Color.B));
      ColorName = colorDialog.Color.Name.ToLower();
 }
Comment

WPF color picker

// install Extended.Wpf.Toolkit

xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"

<xctk:ColorPicker Name="ClrPcker_Background" SelectedColorChanged="ClrPcker_Background_SelectedColorChanged"></xctk:ColorPicker>

private void ClrPcker_Background_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color> e)
{
    TextBox.Text = "#" + ClrPcker_Background.SelectedColor.R.ToString() + ClrPcker_Background.SelectedColor.G.ToString() + ClrPcker_Background.SelectedColor.B.ToString();
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: get file extension in c# file upload 
Csharp :: c# remove rows from datatable 
Csharp :: convert string to jtoken c# 
Csharp :: unity check gameobject active 
Csharp :: how to remove white spaces from string in c# 
Csharp :: dotnet automapper.extensions.microsoft.dependencyinjection 
Csharp :: dotnet core 3.1 get the user that just logged in 
Csharp :: lcm of list of number 
Csharp :: how to select time and date in datetimepicker in c# 
Csharp :: c# get certain character from string 
Csharp :: how to make an ui to follow gameobject 
Csharp :: getter setter c# 
Csharp :: set rotation unity 
Csharp :: multiplication of long number 
Csharp :: c# datetime for filename 
Csharp :: sort file name with C# 
Csharp :: check property type of collection c# 
Csharp :: C# network traffic 
Csharp :: c# alphabetize a list of string 
Csharp :: how to close a form c# 
Csharp :: from string 
Csharp :: pyautogui not odwnloading 
Csharp :: random mac address c# 
Csharp :: char array 
Csharp :: c# random number between 0 and 1 
Csharp :: Map Range Clamped unity 
Csharp :: get number of days between two dates c# 
Csharp :: C# Read() and ReadKey() 
Csharp :: get device name c# console 
Csharp :: reload usercontol wpf 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =