MainWindow.xaml.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System.Text;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. using System.Windows.Data;
  5. using System.Windows.Documents;
  6. using System.Windows.Input;
  7. using System.Windows.Media;
  8. using System.Windows.Media.Imaging;
  9. using System.Windows.Navigation;
  10. using System.Windows.Shapes;
  11. namespace EdgeVoyagerWPF
  12. {
  13. /// <summary>
  14. /// Interaction logic for MainWindow.xaml
  15. /// </summary>
  16. public partial class MainWindow : Window
  17. {
  18. public MainWindow()
  19. {
  20. InitializeComponent();
  21. }
  22. private void Bold_Checked(object sender, RoutedEventArgs e)
  23. {
  24. textBox1.FontWeight = FontWeights.Bold;
  25. }
  26. private void Bold_Unchecked(object sender, RoutedEventArgs e)
  27. {
  28. textBox1.FontWeight = FontWeights.Normal;
  29. }
  30. private void Italic_Checked(object sender, RoutedEventArgs e)
  31. {
  32. textBox1.FontStyle = FontStyles.Italic;
  33. }
  34. private void Italic_Unchecked(object sender, RoutedEventArgs e)
  35. {
  36. textBox1.FontStyle = FontStyles.Normal;
  37. }
  38. private void IncreaseFont_Click(object sender, RoutedEventArgs e)
  39. {
  40. if (textBox1.FontSize < 18)
  41. {
  42. textBox1.FontSize += 2;
  43. }
  44. }
  45. private void DecreaseFont_Click(object sender, RoutedEventArgs e)
  46. {
  47. if (textBox1.FontSize > 10)
  48. {
  49. textBox1.FontSize -= 2;
  50. }
  51. }
  52. }
  53. }