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_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 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; } }