private void Button_SpotDetailFont_Click(object sender, RoutedEventArgs e)
 {
     ColorFont.ColorFontDialog fntDialog = new ColorFont.ColorFontDialog();
     fntDialog.Owner = this;
     fntDialog.Font  = FontInfo.GetControlFont(this.SpotDetailList[0]);
     if (fntDialog.ShowDialog() == true)
     {
         SettingInfo.SpotDetailFontInfo = fntDialog.Font;
     }
 }
 private void Button_TitleFont_Click(object sender, RoutedEventArgs e)
 {
     ColorFont.ColorFontDialog fntDialog = new ColorFont.ColorFontDialog();
     fntDialog.Owner = this;
     fntDialog.Font  = FontInfo.GetControlFont(this.TextBox_Title);
     if (fntDialog.ShowDialog() == true)
     {
         SettingInfo.TitleFontInfo = fntDialog.Font;
     }
 }
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     ColorFont.ColorFontDialog fntDialog = new ColorFont.ColorFontDialog();
     fntDialog.Owner = this;
     fntDialog.Font = FontInfo.GetControlFont(this.txtText);
     if (fntDialog.ShowDialog() == true)
     {
         FontInfo selectedFont = fntDialog.Font;
         
         if (selectedFont != null)
         {
             FontInfo.ApplyFont(this.txtText, selectedFont);
         }
     }
 }
예제 #4
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            ColorFont.ColorFontDialog fntDialog = new ColorFont.ColorFontDialog();
            fntDialog.Owner = this;
            fntDialog.Font  = FontInfo.GetControlFont(this.txtText);
            if (fntDialog.ShowDialog() == true)
            {
                FontInfo selectedFont = fntDialog.Font;

                if (selectedFont != null)
                {
                    FontInfo.ApplyFont(this.txtText, selectedFont);
                }
            }
        }
        void newBtn_Click(object sender, RoutedEventArgs e)
        {
            ColorFont.ColorFontDialog fntDialog = new ColorFont.ColorFontDialog();
            //fntDialog.Owner = this;
            Canvas canva2 = ((tabs.SelectedItem as TabItem).Content as StackPanel).Children[0] as Canvas;

            foreach (TextBlock a in canva2.Children.OfType <TextBlock>())
            {
                if (a.Name == (sender as Button).Name)
                {
                    Control s = new Control();
                    s.FontFamily   = a.FontFamily;
                    s.FontSize     = a.FontSize;
                    s.FontWeight   = a.FontWeight;
                    s.FontStyle    = a.FontStyle;
                    s.Foreground   = a.Foreground;
                    fntDialog.Font = FontInfo.GetControlFont(s as Control);
                }
            }
            if (fntDialog.ShowDialog() == true)
            {
                Canvas canva = ((tabs.SelectedItem as TabItem).Content as StackPanel).Children[0] as Canvas;
                foreach (TextBlock a in canva.Children.OfType <TextBlock>())
                {
                    if (a.Name == (sender as Button).Name)
                    {
                        FontInfo selectedFont = fntDialog.Font;
                        if (selectedFont != null)
                        {
                            a.FontFamily = selectedFont.Family;
                            a.FontSize   = selectedFont.Size;
                            a.FontWeight = selectedFont.Weight;
                            a.FontStyle  = selectedFont.Style;
                        }
                    }
                }
            }
            //throw new NotImplementedException();
        }
예제 #6
0
        /// <summary>
        /// Opens the Font dialog.
        /// </summary>
        /// <param name="sender">Not used.</param>
        /// <param name="e">Not used.</param>
        private void selectFonts_Click(object sender, RoutedEventArgs e)
        {
            var taskFontDialog = new ColorFontDialog();

            taskFontDialog.Font = this.TaskListFont;

            var fontResult = taskFontDialog.ShowDialog();

            if (fontResult == true)
            {
                this.TaskListFont = taskFontDialog.Font;
            }
        }
예제 #7
0
 private void btFont_Click(object sender, RoutedEventArgs e)
 {
     ColorFontDialog fntDialog = new ColorFontDialog();
     fntDialog.Owner = this;
     fntDialog.Font = FontInfo.GetControlFont(this.tbExample);
     if (fntDialog.ShowDialog() == true)
     {
         FontInfo selectedFont = fntDialog.Font;
         if (selectedFont != null)
         {
             FontInfo.ApplyFont(this.tbExample, selectedFont);
         }
     }
 }
 void newBtn_Click(object sender, RoutedEventArgs e)
 {
     ColorFont.ColorFontDialog fntDialog = new ColorFont.ColorFontDialog();
     //fntDialog.Owner = this;
     Canvas canva2 = ((tabs.SelectedItem as TabItem).Content as StackPanel).Children[0] as Canvas;
     foreach (TextBlock a in canva2.Children.OfType<TextBlock>())
     {
         if (a.Name == (sender as Button).Name)
         {
             Control s = new Control();
             s.FontFamily = a.FontFamily;
             s.FontSize = a.FontSize;
             s.FontWeight = a.FontWeight;
             s.FontStyle = a.FontStyle;
             s.Foreground = a.Foreground;
             fntDialog.Font = FontInfo.GetControlFont(s as Control);
         }
     }
     if (fntDialog.ShowDialog() == true)
     {
         Canvas canva = ((tabs.SelectedItem as TabItem).Content as StackPanel).Children[0] as Canvas;
         foreach (TextBlock a in canva.Children.OfType<TextBlock>())
         {
             if (a.Name == (sender as Button).Name)
             {
                 FontInfo selectedFont = fntDialog.Font;
                 if (selectedFont != null)
                 {
                     a.FontFamily = selectedFont.Family;
                     a.FontSize = selectedFont.Size;
                     a.FontWeight = selectedFont.Weight;
                     a.FontStyle = selectedFont.Style;
                 }
             }
         }
     }
     //throw new NotImplementedException();
 }