private void ButtonOAFontFamily_Click(object sender, RoutedEventArgs e) { FontDialog fd = new FontDialog(); fd.Font = new Font(LPTED.OADisplay.FontFamily.ToString(), LPTED.OADisplay.FontSize); if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LPTED.SavePage(NowPage); //先保存 LPTED.OADisplay.FontFamily = new FontFamily(fd.Font.FontFamily.Name); //储存设置 LPTED.OADisplay.FontSize = fd.Font.Size; ButtonOAFontFamily.Content = "字体:" + fd.Font.FontFamily.Name; LPTED.DisplaySource(NowPage);//重新加载 } fd.Dispose(); }
private void ChangeOAFontSize() { if (!float.TryParse(ComboBoxOAFontSize.Text, out float fsize)) { MessageBox.Show("请输入数字", "设置字体大小"); return; } if (LPTED.OADisplay.FontSize.ToString("f1") != fsize.ToString("f1")) { LPTED.SavePage(NowPage);//先保存 //储存设置 LPTED.OADisplay.FontSize = fsize; LPTED.DisplaySource(NowPage); //重新加载 //重新绘制全部图片 RefreshLeftPanelAll(); } }
/// <summary> /// 左侧按钮被选中 /// </summary> /// <param name="sender">按钮</param> /// <param name="e">信息</param> private void Bt_Click(object sender, RoutedEventArgs e) { int chosepage = Convert.ToInt32(((Button)sender).Name.Substring(2)); //MessageBox.Show(chosepage.ToString()); //刷新当前页面 RefreshLeftPanelSingle(); if (NowPage == chosepage) { return; } //储存 LPTED.SavePage(NowPage); //跳转 NowPage = chosepage; MarkLeftPanelColor(); LPTED.DisplaySource(NowPage); }
private void ButtonDeletePage_Click(object sender, RoutedEventArgs e) { if (LPTED.EachPage.Count == 1) { MessageBox.Show("最后一页面无法删除", "删除失败"); return; } if (MessageBox.Show("确认删除该页面吗,此操作无法撤回", "删除本页面", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { IsChange = true; LPTED.EachPage.RemoveAt(NowPage); if (NowPage >= LPTED.EachPage.Count) { NowPage = LPTED.EachPage.Count - 1; } RefreshLeftPanelAll(); MarkLeftPanelColor(); LPTED.DisplaySource(NowPage); } }
private void ButtonOAFontColor_Click(object sender, RoutedEventArgs e) { ButtonOAFontColor.IsChecked = false; ColorDialog cd = new ColorDialog(); cd.CustomColors = CustomColors; cd.Color = ColorConvent(LPTED.OADisplay.FontColor); if (cd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LPTED.SavePage(NowPage);//先保存 LPTED.OADisplay.FontColor = ColorConvent(cd.Color); ButtonOAFontColor.Background = new SolidColorBrush(LPTED.OADisplay.FontColor); LPTED.DisplaySource(NowPage);//重新加载 //重新绘制全部图片 RefreshLeftPanelAll(); } //储存自定义颜色 CustomColors = cd.CustomColors; cd.Dispose(); }