private void button_Color_Click(object sender, RoutedEventArgs e) { var dlg = new ColorSetWindow(((SolidColorBrush)((Button)sender).Background).Color, this); if (dlg.ShowDialog() == true) { ((Button)sender).Background = new SolidColorBrush(dlg.GetColor()); } }
private void button_colorTitle2_Click(object sender, RoutedEventArgs e) { ColorSetWindow dlg = new ColorSetWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; Color item = custTitleColor2; dlg.SetColor(item); if (dlg.ShowDialog() == true) { dlg.GetColor(ref item); custTitleColor2 = item; titleColor2.Color = custTitleColor2; } }
private void button17_Click(object sender, RoutedEventArgs e) { ColorSetWindow dlg = new ColorSetWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; Color item = custColorList[0x14]; dlg.SetColor(item); if (dlg.ShowDialog() == true) { dlg.GetColor(ref item); custColorList[0x14] = item; backColor17.Color = custColorList[0x14]; } }
private void button_Color_Click(object sender, RoutedEventArgs e) { var btn = sender as Button; var dlg = new ColorSetWindow(); dlg.Owner = CommonUtil.GetTopWindow(this); Color item = (btn.Background as SolidColorBrush).Color; dlg.SetColor(item); if (dlg.ShowDialog() == true) { dlg.GetColor(ref item); (btn.Background as SolidColorBrush).Color = item; } }
private void button_Color_Click(object sender, RoutedEventArgs e) { ColorSetWindow dlg = new ColorSetWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; Color item = ((SolidColorBrush)((Button)sender).Background).Color; dlg.A = item.A; dlg.R = item.R; dlg.G = item.G; dlg.B = item.B; if (dlg.ShowDialog() == true) { ((SolidColorBrush)((Button)sender).Background).Color = Color.FromArgb(dlg.A, dlg.R, dlg.G, dlg.B); OnUpdateColor(); } }