public void Underline(RichEditBox ThisSelectedText) { if (ThisSelectedText.Document.Selection.CharacterFormat.Underline == Windows.UI.Text.UnderlineType.Single) ThisSelectedText.Document.Selection.CharacterFormat.Underline = Windows.UI.Text.UnderlineType.None; else ThisSelectedText.Document.Selection.CharacterFormat.Underline = Windows.UI.Text.UnderlineType.Single; }
public static void RichEditBoxSetText(RichEditBox richEditBox, String msg, Windows.UI.Color color, bool fReadOnly) { richEditBox.IsReadOnly = false; richEditBox.Document.SetText(Windows.UI.Text.TextSetOptions.None, msg); richEditBox.Foreground = new SolidColorBrush(color); richEditBox.IsReadOnly = fReadOnly; }
public void Italic(RichEditBox ThisSelectedText) { if (ThisSelectedText.Document.Selection.CharacterFormat.FontStyle == Windows.UI.Text.FontStyle.Italic) ThisSelectedText.Document.Selection.CharacterFormat.FontStyle = Windows.UI.Text.FontStyle.Normal; else ThisSelectedText.Document.Selection.CharacterFormat.FontStyle = Windows.UI.Text.FontStyle.Italic; }
public void Bold(RichEditBox ThisSelectedText) { if (ThisSelectedText.Document.Selection.CharacterFormat.Weight == Windows.UI.Text.FontWeights.ExtraBold.Weight) ThisSelectedText.Document.Selection.CharacterFormat.Weight = Windows.UI.Text.FontWeights.Normal.Weight; else ThisSelectedText.Document.Selection.CharacterFormat.Weight = Windows.UI.Text.FontWeights.ExtraBold.Weight; }
public void shareToDocument(RichEditBox NewRTF, TextBox NewText, TextBox ShareBox, int TotalNumberOFNotepads=8) { String thisContent; String GroupItemForTitle = "Group-1-Item-" + TotalNumberOFNotepads; try { NewRTF.Document.SetText(Windows.UI.Text.TextSetOptions.None, ShareBox.Text); NewRTF.Document.GetText(Windows.UI.Text.TextGetOptions.AdjustCrlf, out thisContent); } catch (Exception) { thisContent = "Wrong Format!"; } }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); var consolas = new FontFamily("Consolas"); var fontSize = 14.0; this.xEditBox = this.GetTemplateChild("xEditBox") as RichEditBox; this.xEditBox.IsSpellCheckEnabled = false; this.xEditBox.IsTextPredictionEnabled = false; this.xEditBox.UseLayoutRounding = false; this.xEditBox.FontFamily = consolas; this.xEditBox.FontSize = fontSize; this.xEditBox.Background = new SolidColorBrush(Colors.Transparent); this.xEditBox.Foreground = new SolidColorBrush(colorText); this.xEditBox.Loaded += (a, b) => { this.xEditBox.KeyUp += XEditBox_KeyUp; this.xEditBox.TextChanging += XEditBox_TextChanging; }; }
public Boolean PinToStartNow(RichEditBox Business) { try { var tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); var plannedUpdated = tileUpdater.GetScheduledTileNotifications(); XmlDocument documentNow = new XmlDocument(); String ContentsForPinToSart; Business.Document.GetText(Windows.UI.Text.TextGetOptions.AdjustCrlf, out ContentsForPinToSart); if (ContentsForPinToSart.Length > 100) ContentsForPinToSart = ContentsForPinToSart.Remove(101); const string xml = @"<tile><visual> <binding template=""TileSquareText02""><text id=""1"">{0}</text><text id=""2"">{1}</text></binding> <binding template=""TileWideText01""><text id=""1"">{0}</text><text id=""2"">{1}</text><text id=""3""></text><text id=""4""></text><text id=""5""></text></binding> </visual></tile>"; var xmlNow = String.Format(xml, "", ContentsForPinToSart); var newUpdate = new TileNotification(documentNow); documentNow.LoadXml(xmlNow); //documentNow = <title> String Test </title>; if (String.IsNullOrWhiteSpace(ContentsForPinToSart)) { tileUpdater.Clear(); } else { tileUpdater.Update(newUpdate); } } catch { return false; } return true; }
public string FontsPicker(RichEditBox ThisSelectedText, List<string> AvalibleFonts = null) { if (AvalibleFonts == null) AvalibleFonts = AllFonts; if (NextFontElement >= AvalibleFonts.Count() - 1) NextFontElement = 0; else NextFontElement++; try { NewFont = AvalibleFonts.ElementAt(NextFontElement); ThisSelectedText.FontFamily = new FontFamily(NewFont); } catch { NewFont = "OutofRange"; }; return NewFont + '\n' + (NextFontElement + 1).ToString() + " of " + AllFonts.Count.ToString(); }
public static void RichEditBoxSetMsg(RichEditBox richEditBox, String msg, bool fReadOnly) { RichEditBoxSetText(richEditBox, msg, Windows.UI.Colors.Black, fReadOnly); }
public static void RichEditBoxSetError(RichEditBox richEditBox, String errorMsg) { RichEditBoxSetText(richEditBox, errorMsg, Windows.UI.Colors.Red, true); }
public void SetMailBox(RichEditBox MailBox) { this.MailBox = MailBox; }
public RichEditBoxEvents(RichEditBox This) : base(This) { this.This = This; }